/*  style.css        */
:root {
  --bg: #e9f7ff;
  --fg: #0f172a;
  --muted: #64748b;
  --ring: #bae6fd;
  --card: #fff;
  --accent: #0ea5e9;
  --accent2: #38bdf8;
  --danger: #ef4444;
  --shadow: 0 8px 24px rgba(2, 132, 199, .15);
  --radius: 16px;
  --z-tabs: 50;
  --thumbnail_width: 500px;
  --logo_width: 500px;
  --image_width: 800px;
}

/* 全体レイアウト */
html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  background-color: #e6f4ff;
  color: #111;
  /* 固定部分の高さに応じて調整 */
  padding-top: 90px;

}

input,
select {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
  outline: none;
  align-items: right;
  border-radius: 10px;
}

.user {
  width: 100px;
}

/* ラッパー */
.tw-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ヘッダー */
.tw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #e6f4ff;
  /* ページ背景に馴染む */
  z-index: 2000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  padding-top: 8px;
  padding-bottom: 4px;
}

.fixed-header .tw-header,
.fixed-header .tw-card {
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 12px;
}

/* pill 表示 */
.pill {
  background: #eee;
  border-radius: 12px;
  padding: 2px 8px;
  margin-left: 8px;
  font-size: 12px;
}

.btn.login,
.btn.logout {
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  margin-left: 12px;
  cursor: pointer;
  font-size: 14px;
}

/* リネームボタン */
.btn.rename {
  background: rgb(148, 237, 233);
  color: black;
  border-radius: 5px;
}

/* ログインボタン */
.btn.login {
  background: chartreuse;
  color: black;
}

/* ログアウトボタン */
.btn.logout {
  background: #85BBCF;
  color: #fff;
}

.btn.logout:hover {
  background: #139CCF;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  color: #fff
}

.btn-download,
.btn.gacha {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  width: 100px;
  height: 30px;
  padding: 5px;
  color: #fff
}

.btn.gacha {
  font-size: 7pt !important;
}

.btn-mainback {
  background: linear-gradient(180deg, lightgreen, green);
  color: #fff;
  text-decoration: none !important
}

.btn-ghost {
  background: #f0fbff;
  border: 1px solid var(--ring);
  color: #0369a1
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed
}

/* 無効ユーザー行 */
.disabled-row {
  /* 行背景色を灰色に */
  background-color: #ddd;
}

/* 無効ユーザー文字 */
#info_user {
  /* 文字を太く */
  font-weight: bold;
}

/* タブUI  */
.tw-card {
  margin-top: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  padding: 12px;
  background: #eaffff;
}

.tw-tabbar {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 12px;
}

.tw-tab {
  background: #bcffdd;
  border: 1px solid #ccc;
  padding: 6px 14px 8px 14px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  width: 100px;
}

.tw-tab:hover {
  background: #f3f4f6;
}

.tw-tab.active {
  background-color: palegreen;
  border-bottom: 3px solid #0ea5e9;
  color: blue;
  font-weight: bold;
  text-shadow:
    3px 3px 0 #bcffdd,
    -1px -1px 0 #bcffdd,
    1px -1px 0 #bcffdd,
    -1px 1px 0 #bcffdd,
    1px 1px 0 #bcffdd;
}

.tw-panels {
  padding: 8px;
}

.tw-panel {
  display: block;
  background: #eaffff;
}

.tw-panel[style*="display: block"],
.tw-panel[style*="display:block"] {
  display: block;
}

/* 管理者タブ用  */

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 8px;
}

table th,
table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: left;
  font-size: 14px;
}

table th {
  background-color: #f1f5f9;
  font-weight: 600;
}

table input,
table select {
  padding: 4px;
  font-size: 13px;
}

.disabled-row {
  background-color: #e5e7eb;
  color: #6b7280;
}

.update-btn,
.delete-btn {
  padding: 4px 8px;
  margin-right: 4px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.update-btn {
  background: #3b82f6;
  color: #fff;
}

.update-btn:hover {
  background: #2563eb;
}

.delete-btn {
  background: #ef4444;
  color: #fff;
}

.delete-btn:hover {
  background: #dc2626;
}

/* フローティングウィンドウ */
.floating-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 2px solid #0ea5e9;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 1000;
}

.floating-header {
  background-color: #1e90ff;
  color: white;
  padding: 6px 10px;
  border-radius: 8px 8px 0 0;
  text-align: left;
}

.floating-body {
  padding: 12px;
}

.floating-footer {
  text-align: center;
  margin-top: 10px;
}

.floating-footer .btn {
  background-color: #1e90ff;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  cursor: pointer;
}

.floating-footer .btn:hover {
  background-color: #4682b4;
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.close-btn:hover {
  color: #ffe4e6;
}

/* Utility */
h2 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 18px;
}

h3 {
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 16px;
}

ul {
  margin: 8px 0;
  padding-left: 20px;
}

ul li {
  margin-bottom: 4px;
}

/* style.css */
.disabled-row {
  background-color: #ddd;
}

#info {
  font-weight: bold;
}

/* 曜日色 */
.weekday-sun {
  color: red;
}

.weekday-sat {
  color: blue;
}

.weekday-normal {
  color: black;
}

.marker {
  background: linear-gradient(transparent 50%, yellow 50%);
}

/* 光るアニメーション（右→左） */
#oauth-title {
  font-size: x-large;
  background-image: radial-gradient(circle, #e5e5ff 0%, #c6c6ff 100%);
  border-radius: 10px;
  position: relative;
  display: inline-block;
  /* テキスト幅にフィット */
  overflow: hidden;
  /* はみ出しを隠す */
}

#oauth-title::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  /* ← 最初は右外に配置 */
  width: 100%;
  height: 100%;
  background-image: linear-gradient(-130deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.5) 80%,
      rgba(255, 255, 255, 1) 81%,
      rgba(255, 255, 255, 0) 100%);
  animation: shine-right-left 3s infinite;
}

#oauth-explain {
  font-size: large;
  background-image: radial-gradient(circle, #8a8afe 0%, #9b9be8 100%);
  border-radius: 8px;
  padding: 0 10px 0 10px;
  position: relative;
  display: inline-block;
  /* テキスト幅にフィット */
  overflow: hidden;
  /* はみ出しを隠す */
}

#oauth-explain::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  /* ← 最初は右外に配置 */
  width: 100%;
  height: 100%;
  background-image: linear-gradient(-130deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.5) 80%,
      rgba(255, 255, 255, 1) 81%,
      rgba(255, 255, 255, 0) 100%);
  animation: shine-right-left 3s infinite;
}

#sortGameInput {
  width: 80%;
}

@keyframes shine-right-left {
  33% {
    right: 100%;
    /* ← 右から左へ流れる */
  }

  100% {
    right: 100%;
  }
}

.accordion {
  border-radius: 8px;
  overflow: hidden;
}

.accordion-item+.accordion-item {
  border-top: 1px solid #ccc;
}

.accordion-header {
  width: 100%;
  background: #aaf5cc;
  border: none;
  outline: none;
  text-align: left;
  padding: 3px;
  font-size: 11px;
  cursor: pointer;
}

.accordion-header.active {
  background: palegreen;
  font-weight: bold;
}

.accordion-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
}

/* アコーディオン開閉最大高さ */
.accordion-item.active .accordion-content {
  max-height: 2000px;
}

/* ===== D&D: まとめ投入エリア（独自ルール） =====
   レスポンシブを維持しつつ、最大 500x400 に制限 */
.drop {
  border: 2px dashed var(--ring);
  border-radius: 12px;
  padding: 12px;
  background: #f8fdff;
  transition: box-shadow .2s, background .2s;
  width: 100%;
  max-width: 500px;
  height: auto;
  max-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.drop.drag {
  background: #e6f4ff;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .25) inset
}

.pulse {
  animation: pulse 1.2s ease
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, .35) inset
  }

  100% {
    box-shadow: 0 0 0 14px rgba(56, 189, 248, 0) inset
  }
}

/* ===== 結果グリッド ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px
}

.thumb {
  border: 1px solid #cfe9ff;
  border-radius: 12px;
  overflow: hidden;
  background: #fff
}

.thumb img {
  display: block;
  width: 100%;
  height: auto
}

.thumb .meta {
  padding: 8px
}

/* ===== Summary & Messages ===== */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0fbff;
  border: 1px solid var(--ring);
  font-weight: 700
}

.list {
  margin: .4em 0 .8em;
  padding-left: 1.2em
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace
}

.ok {
  color: #065f46
}

.error {
  color: #b91c1c;
  white-space: pre-wrap
}

/* ===== 個別9入力（画像ファイルタブ） =====
   ・各枠自体を「小さめのD&Dエリア」にする
   ・デスクトップでは 5 列レイアウト → 1行目に _0～_4、2行目に _5～_8 が自然に並ぶ
   ・画面幅が狭い場合は 3列/2列に自動で落としてレスポンシブに */
.mini-uploader {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

@media (max-width: 980px) {
  .mini-uploader {
    grid-template-columns: repeat(3, minmax(140px, 1fr))
  }
}

@media (max-width: 620px) {
  .mini-uploader {
    grid-template-columns: repeat(2, minmax(140px, 1fr))
  }
}

/* 各ミニ枠を D&D 可能な見た目にする */
.mini-item {
  border: 2px dashed #dbeafe;
  background: #f8fbff;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  transition: box-shadow .2s, background .2s, border-color .2s;
  min-height: 92px;
  /* 小さめ見た目のための高さ */
}

.mini-item.drag {
  background: #eef6ff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, .25) inset
}

.mini-item label {
  font-size: 12px;
  color: #0369a1;
  font-weight: 700
}

.mini-item .note {
  font-size: 11px;
  color: #64748b
}

.mini-item .chosen {
  font-size: 12px;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #e6effe;
  border-radius: 8px;
  padding: 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-item input[type=file] {
  font-size: 12px
}

/* 「選択: x/9」を右寄せしたい場面向けのユーティリティ */
.ml-auto {
  margin-left: auto
}

/* ===== 事前プレビュー（独自ルール・合成前） ===== */
.pre-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.pre-card {
  border: 1px solid #e6f4ff;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, .08);
}

.pre-card .hd {
  padding: 8px 10px;
  font-size: 12px;
  color: #0369a1;
  background: #f0fbff;
  border-bottom: 1px solid #e6f4ff
}

.pre-card img {
  display: block;
  width: 100%;
  height: auto
}


/* ===== ファイル入力ボタンのカスタムデザイン ===== 
.file-input {
  display: inline-block;
  padding: 8px 16px;
  background-color: var(--accent, #0ea5e9);
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
} */
.file-input {
  display: inline-block;
  padding: 6px 12px;
  background-color: var(--accent, #0ea5e9);
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.file-input:hover {
  background-color: var(--accent2, #38bdf8);
}

.file-input:active {
  background-color: var(--accent, #0284c7);
}

.file-input span {
  pointer-events: none;
  /* 子要素はクリック無効化して label 全体に反応させる */
}

/* 選択ファイル名を表示する用 */
.file-chosen {
  margin-left: 8px;
  font-size: 0.9em;
  color: var(--muted, #64748b);
}

/* ============================= */
/* サイコロ（dice.js対応）       */
/* ============================= */

/* サイコロ全体ラッパー */
#dice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  /* プレイヤー間の間隔 */
  margin: 20px auto;
  perspective: 1000px;
  /* 3D効果 */
}

/* プレイヤーごとのサイコロ配置 */
.player-dice {
  display: flex;
  flex-direction: row;
  /* 横並び */
  gap: 12px;
  /* サイコロ間隔 */
  align-items: center;
  justify-content: center;
}

.player-label {
  font-weight: bold;
  margin-right: 8px;
  text-align: center;
}

#num_ticket:disabled {
  background-color: darkgrey;
}


/* ダイス */
/* ============================= */
/* サイコロ（dice.js対応）       */
/* ============================= */

/* サイコロ全体ラッパー */
#dice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  /* プレイヤー間の間隔 */
  margin: 20px auto;
  perspective: 1000px;
  /* 3D効果 */
}

/* プレイヤーごとのサイコロ配置 */
.player-dice {
  display: flex;
  flex-direction: row;
  /* 横並び */
  gap: 12px;
  /* サイコロ間隔 */
  align-items: center;
  justify-content: center;
}

.player-label {
  font-weight: bold;
  margin-right: 8px;
  text-align: center;
}

/* ダイス本体 */
.dice {
  width: 100px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform 1s ease;

}

.dice-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s ease;
  /* ← これ必須 */
}

.dice-face,
.face {
  position: absolute;
  width: 100px;
  height: 100px;
  backface-visibility: hidden;
  /* 裏面を非表示にして消える問題防止 */
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  border: 2px solid #0369a1;
  background: #fff;
  font-size: 32px;
  font-weight: bold;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

/* 各面の配置（dice-face系） */
.dice-face.front {
  transform: rotateY(0deg) translateZ(50px);
}

.dice-face.back {
  transform: rotateY(180deg) translateZ(50px);
}

.dice-face.right {
  transform: rotateY(90deg) translateZ(50px);
}

.dice-face.left {
  transform: rotateY(-90deg) translateZ(50px);
}

.dice-face.top {
  transform: rotateX(90deg) translateZ(50px);
}

.dice-face.bottom {
  transform: rotateX(-90deg) translateZ(50px);
}

/* 各面の配置（dice.js側 .face1～.face6 に対応） */
.face1 {
  transform: rotateY(0deg) translateZ(50px);
}

.face2 {
  transform: rotateY(90deg) translateZ(50px);
}

.face3 {
  transform: rotateY(180deg) translateZ(50px);
}

.face4 {
  transform: rotateY(-90deg) translateZ(50px);
}

.face5 {
  transform: rotateX(90deg) translateZ(50px);
}

.face6 {
  transform: rotateX(-90deg) translateZ(50px);
}

/* ドット */
.dot {
  width: 20px;
  height: 20px;
  background: #111;
  border-radius: 50%;
}

/* 出目配置用の補助クラス */
.face-1 .dot {
  grid-area: c;
}

.face-2 .dot:nth-child(1) {
  grid-area: a;
}

.face-2 .dot:nth-child(2) {
  grid-area: i;
}

.face-3 .dot:nth-child(1) {
  grid-area: a;
}

.face-3 .dot:nth-child(2) {
  grid-area: c;
}

.face-3 .dot:nth-child(3) {
  grid-area: i;
}

.face-4 .dot:nth-child(1) {
  grid-area: a;
}

.face-4 .dot:nth-child(2) {
  grid-area: b;
}

.face-4 .dot:nth-child(3) {
  grid-area: h;
}

.face-4 .dot:nth-child(4) {
  grid-area: i;
}

.face-5 .dot:nth-child(1) {
  grid-area: a;
}

.face-5 .dot:nth-child(2) {
  grid-area: b;
}

.face-5 .dot:nth-child(3) {
  grid-area: c;
}

.face-5 .dot:nth-child(4) {
  grid-area: h;
}

.face-5 .dot:nth-child(5) {
  grid-area: i;
}

.face-6 .dot:nth-child(1) {
  grid-area: a;
}

.face-6 .dot:nth-child(2) {
  grid-area: b;
}

.face-6 .dot:nth-child(3) {
  grid-area: d;
}

.face-6 .dot:nth-child(4) {
  grid-area: f;
}

.face-6 .dot:nth-child(5) {
  grid-area: h;
}

.face-6 .dot:nth-child(6) {
  grid-area: i;
}

/* グリッド配置 */
.dice-face {
  display: grid;
  grid-template-areas:
    "a . b"
    ". c ."
    "h . i";
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

/* SVG ピップを使う場合の補助 */
.pip-svg {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.result {
  margin-top: 20px;
  font-size: 20px;
  font-weight: bold;
}

.dice.rolling {
  animation: rollDice 1s ease;
}

/* ============================= */
/* サイコロ配置エリア (dice-area)*/
/* ============================= */
.dice-area {
  display: flex;
  flex-direction: row;
  /* 横並び */
  flex-wrap: wrap;
  /* はみ出し時は折返し */
  justify-content: center;
  /* 中央寄せ */
  gap: 16px;
  /* サイコロの間隔 */
  margin-top: 12px;
}

/* ============================= */
/* サイコロ設定エリア controls   */
/* ============================= */
.controls {
  display: flex;
  /* 横並び */
  flex-direction: row;
  /* 水平方向 */
  flex-wrap: wrap;
  /* はみ出したら折返し */
  align-items: center;
  /* 縦位置を中央揃え */
  gap: 12px;
  /* 各要素の間隔 */
}

.controls label {
  margin-right: 4px;
  white-space: nowrap;
  /* ラベルが折返さないようにする */
}

.controls select,
.controls input[type="text"] {
  margin-right: 8px;
}

/* 説明 */
.rule-game-sort {
  font-size: 10pt;
  color: dodgerblue;
  border: 1px solid #0369a1;
  background-color: #efefff;
  border-radius: 8px;
  max-height: 80px;
  /* 初期状態で小さく表示 */
  overflow: hidden;
  transition: max-height 0.4s ease;
  cursor: pointer;
}

/* 開いたときの状態 */
.rule-game-sort.open {
  max-height: 800px;
  /* 開いたときの高さを十分に */
}

/* フェードアニメーション用クラス */
.fade-area {
  transition: opacity 0.5s ease;
  /* 0.5秒で切替 */
  opacity: 1;
}

.fade-area.fade-out {
  opacity: 0;
}

.fade-area.fade-in {
  opacity: 1;
}

/* ============================= */
/* サイコロ（dice.js対応） EOF   */
/* ============================= */

.btn.entry_reset,
.btn.entry_action {
  font-size: 1rem;
  /* 視認性の高い大きめフォント */
  font-weight: 700;
  /* 太字で操作感を強調 */
  line-height: 1.5;
  position: relative;
  display: inline-block;
  padding: 1px 4px;
  /* 横長デザインで操作性を確保 */
  cursor: pointer;
  /* カーソルを指マークに */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-transition: all 0.3s;
  /* ホバー時のアニメーション */
  transition: all 0.3s;
  text-align: center;
  vertical-align: middle;
  text-decoration: none;
  letter-spacing: 0.1em;
  color: #212529;
  /* 標準文字色 */
  border-radius: 0.5rem;
  /* やや丸みを帯びた角 */
  border: 2px solid #000;
  /* 明確な黒枠 */
  -webkit-box-shadow: 4px 4px 0 #000;
  /* 立体的シャドウ */
  box-shadow: 4px 4px 0 #000;
}

/* ============================================================
 * ホバー時（共通）
 * シャドウの方向を反転して押下感を表現
 * ============================================================ */
.btn.entry_reset:hover,
.btn.entry_action:hover {
  -webkit-box-shadow: -4px -4px 0 #000;
  box-shadow: -4px -4px 0 #000;
  transform: translate(2px, 2px);
  /* 軽く沈む動き */
}

/* ============================================================
 * ならびかえリセットボタン（背景色: deepskyblue）
 * ============================================================ */
.btn.entry_reset {
  background: deepskyblue;
  /* 鮮やかな空色 */
  color: black;
  /* 黒文字でコントラスト確保 */
}

.btn.entry_reset:hover {
  background: #00bfffcc;
  /* 少し透明化して光沢感 */
}

/* ============================================================
 * ならびかえ確定・更新ボタン（背景色: lightskyblue）
 * ============================================================ */
.btn.entry_action {
  background: lightskyblue;
  /* 落ち着いた青 */
  color: black;
}

.btn.entry_action:hover {
  background: #87cefab3;
  /* 軽く透明化して押下演出 */
}

/* フォーカス時（共通） */
.btn.entry_reset:focus,
.btn.entry_action:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* 非表示状態 */
.floating-hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* 表示状態 */
.floating-visible {
  display: block !important;
  opacity: 1;
  pointer-events: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  padding: 1px;
  /* 白余白を少し減らす 
  min-width: 300px;
  max-width: 90%;
  */
  width: 500px;
  height: 140px;
  text-align: center;
  border: solid 2px #1e90ff;
  /* 淡い青で統一 */
}

/* 背面の灰色オーバーレイ */
#floating-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  /* 半透明グレー */
  z-index: 998;
  /* モーダル本体(999)より1つ下 */
  display: none;
  /* モーダル非表示時に非表示 */
}

/* 表示状態のとき背景も有効化 */
.floating-visible~#floating-overlay,
#floating-overlay.active {
  display: block !important;
  opacity: 1;
}

/* モーダル本体（既存に追加確認） */
.floating-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  border: 2px solid #0080ff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  padding: 16px;
  z-index: 9999;
  width: 320px;
  text-align: center;
  /* ←中央寄せを追加 */
}

/* === 閉じるボタン中央寄せ === */
#floating-close-footer {
  display: inline-block;
  margin: 10px auto 0 auto;
  /* 上10px・中央寄せ */
  text-align: center;
  float: none;
  /* ← float解除 */
}

#floating-confirm-buttons .common-button {
  margin: 0 10px;
  padding: 6px 14px;
  background-color: #e0f7ff;
  border-radius: 6px;
  cursor: pointer;
}

#floating-confirm-buttons .common-button:hover {
  background-color: #bde9ff;
}

.dm-logo-preview {
  /*
  height: var(--logo_width);
  width: auto;
  object-fit: contain;
  display: block;
  */
  margin: 0 auto;
}


/* ===== SAMPLEウォーターマーク用 ===== */
/* --- SVG透かし確実に前面に出す設定 --- */
.dm-logo-preview {
  height: var(--image_width);
  /* ← 縦固定 */
  width: auto;
  /* ← 横は自動調整 */
  object-fit: contain;
  /* ← 画像が切れず縦横比維持 */
  display: block;
  /* ← レイアウト安定 */
  margin: 0 auto;
  /* ← 中央寄せ */
}

.dm-image-preview {
  height: 300px;
  /* ← 縦固定 */
  width: auto;
  /* ← 横は自動調整 */
  object-fit: contain;
  /* ← 画像が切れず縦横比維持 */
  display: block;
  /* ← レイアウト安定 */
  margin: 0 auto;
  /* ← 中央寄せ */
}

/* ========== DM画像＆ウォーターマーク統一調整 ========== */
.image-preview {
  position: relative !important;
  display: inline-block;
  margin-top: 4px;
  overflow: hidden;
  z-index: 0;

  /* SVGのはみ出し防止 */
}

/* メイン画像（縦固定・中央寄せ） */
.image-preview img.preview-base.dm-image-preview {
  height: 600px;
  /* 縦固定 */
  width: auto !important;
  /* 比率維持 */
  object-fit: contain;
  display: block;
  margin: 0 auto;
  z-index: 1;
}

/* メイン画像（縦固定・中央寄せ） */
.thumbnail-preview img.thumbnail-base.dm-thumbnail-preview {
  height: 100px;
  /* 縦固定 */
  width: auto !important;
  /* 比率維持 */
  object-fit: contain;
  display: block;
  margin: 0 auto;
  z-index: 1;
}


/* thumbnail_width */
.thumbnail-logo-image {
  width: var(--thumbnail_width) !important;
  height: auto;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

/* --------------------------------------------
   ロゴ画像
-------------------------------------------- */
.intro-logo-image {
  /* === 修正: var(--logo_width) の強制上書きを撤廃 → 全体統一 === */
  /* width: var(--logo_width) !important; */
  /* === 変更前 === */
  width: auto !important;
  /* === 修正 === */

  height: auto !important;
  object-fit: contain;
  display: block;
  margin: 0 auto;

  /* === 追加 === */
  max-width: 60%;
}

/* --------------------------------------------
   自己紹介画像（
-------------------------------------------- */
.intro-main-image {
  /* === 修正: var(--image_width) 強制は不要 → auto に統一 === */
  /* width: var(--image_width) !important; */
  /* === 変更前 === */
  width: auto !important;
  /* === 修正 === */

  height: auto !important;
  object-fit: contain;
  display: block;
  margin: 0 auto;

  /* === 修正: 高さ暴走の原因になる 90vh を縮小 === */
  /* max-height: 90vh; */
  /* === 変更前 === */
  max-height: 75vh;
  /* === 修正 === */

  /* === 追加：横幅制御 === */
  max-width: 90%;
}






.image-preview,
.thumbnail-preview {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.image-preview img.preview-base,
.thumbnail-preview img.thumbnail-base {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
  object-fit: contain;
}

/* --- 共通ウォーターマーク --- */
.image-preview img.watermark-overlay,
.thumbnail-preview img.thumbnail-watermark-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 100px;
  height: 100px;
  z-index: 5;
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* --- 補足: スライドグループ内の保護層 --- */
.intro-slide-group .watermark-overlay,
.gacha-slide-group .watermark-overlay {
  z-index: 5;
  opacity: 0.35;
}


/* === DM表示用ベースクラス === */
.dm-text-block {
  margin-top: 10px;
}

/* === 件名・送信日時などの共通ラベル === */
.weekday-label {
  color: black;
  font-size: small;
}

/* === 件名タイトル用 === */
.weekday-title {
  color: blue;
  font-size: small;
}

/* === 曜日別カラー＋フォントサイズ === */
.weekday-red {
  color: red;
  font-size: small;
}

.weekday-blue {
  color: #0000cc;
  font-size: small;
}

.weekday-black {
  color: black;
  font-size: small;
}

/* === DM === */
.dm-count-highlight {
  color: red !important;
  font-weight: bold;
  font-size: large;
}

.dm-content-block {
  padding-left: 10px;
}

/* ① th と td（2列目以外）をセンタリング */
.useragent-accordion-content table th,
.useragent-accordion-content table td:not(:nth-child(2)) {
  text-align: center;
  vertical-align: middle;
}

.useragent-accordion-content table th {
  font-weight: bold;
  text-align: center;
  padding: 8px 12px;
  position: relative;
  background-image: radial-gradient(circle, #b0ffcc 0%, #ccffd9 100%);
  /* palegreen系グラデーション */
  border-radius: 6px;
  overflow: hidden;
}

.image-preview img.thumbnail-watermark-overlay,
.image-preview img.watermark-overlay {
  position: absolute !important;
  /* 既存 relative 基準で上に重ねる */
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 50 !important;
  /* z-index:5 より前面に */
  opacity: 0.35 !important;
  pointer-events: none !important;
  user-select: none !important;
  object-fit: contain !important;
}

/* 光エフェクト（shineアニメーション） */
.useragent-accordion-content table th::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(-130deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.5) 80%,
      rgba(255, 255, 255, 1) 81%,
      rgba(255, 255, 255, 0) 100%);
  animation: shine-right-left 3s infinite;
  pointer-events: none;
  z-index: 1;
}

/* ② aタグ装飾：下線なし＋ホバー時に2pt文字拡大 */
.useragent-accordion-content table a {
  text-decoration: none;
  color: blue;
  transition: font-size 0.2s ease, text-decoration 0.2s ease;
}

.useragent-accordion-content table a:hover {
  font-size: 1.125em;
  /* 約2ptアップ */
  text-decoration: underline;
}

/* ③ 奇数行・偶数行で背景色を交互に変更（th除く） */
.useragent-accordion-content table tr:nth-child(odd):not(:first-child) {
  background-color: #f9ffff;
  /* 薄い水色系 */
}

.useragent-accordion-content table tr:nth-child(even):not(:first-child) {
  background-color: #e6f4ff;
  /* さらに淡い青 */
}

.useragent-sns-logo {
  width: 20px;
  /* 横幅固定 */
  height: 20px;
  /* 高さ固定 */
  background-color: #000;
  display: block;
  /* ブロック要素にして中央寄せ可 */
  margin: 0 auto;
  /* 左右中央寄せ */
  object-fit: contain;
  /* アスペクト比を維持して収める */
  vertical-align: middle;
}


/* =========================================================
   イントロスライドショー（紹介用スライダー）関連スタイル追記
   コンテナ全体（1画面分を覆う領域）
   - 横方向スライドを隠すため overflow: hidden
   - スライド全体を中央寄せ
-------------------------------------------- */
.intro-slide-container,
.gacha-slide-container {
  /* === 修正: wrapper の高さ揺れ対策として最小高さ付与 === */
  min-height: 400px;
  /* === 修正 === */
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
  background-color: #e6f4ff;
}

.intro-slide-wrapper,
.gacha-slide-wrapper {
  display: flex;

  /* === 修正: 幅 100% → 自動に変更（clone数に応じて可変） === */
  /* width: 100%; */
  /* === 変更前 === */
  width: auto;
  /* === 修正 === */

  transition: transform 0.8s ease-in-out;
}

.intro-slide-group,
.gacha-slide-group {
  /* === 修正: flex-basis を 100% → auto に変更（方式Bのズレ防止） === */
  /* flex: 0 0 100%; */
  /* === 変更前 === */
  flex: 0 0 100%;
  /* === 修正（実幅として維持） === */

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;

  /* === 修正: スライドごとの高さ揺れ対策 === */
  min-height: 400px;
  /* === 追加 === */

  gap: 12px;
  text-align: center;
  background: #d0ecff;
  padding: 10px 0;
}

.intro-slide-group img,
.gacha-slide-group img {
  /* === 修正: 幅100% は高さ暴走の原因 → auto に変更 === */
  /* width: 100%; */
  /* === 変更前 === */
  width: auto;
  /* === 修正 === */

  height: auto;
  object-fit: contain;

  /* === 追加: 最大幅制御（スライド枠からはみ出さない） === */
  max-width: 90%;
}

.intro-slide-group.clone,
.gacha-slide-group.clone {
  opacity: 1;
  /* クローンも通常スライドと同じ表示 */
}

.intro-slide-group img.logo,
.gacha-slide-group img.logo {
  width: 60%;
  height: auto;
}

.intro-slide-group img.profile,
.gacha-slide-group img.profile {
  width: 80%;
  max-width: 800px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


/* --------------------------------------------
   通常のロゴ領域（1枚）
-------------------------------------------- */
.intro-logo-block,
.gacha-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  /* === 修正: 高さ揺れの吸収値を追加 === */
  min-height: 120px;
  /* === 修正 === */

  margin-bottom: 8px;
}

/* グループ3専用: ロゴが2枚横並び */
.intro-logo-block-double {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 150px;
  margin-bottom: 8px;
}

.intro-logo-block .image-preview,
.intro-logo-block-double .image-preview,
.gacha-logo-block .image-preview,
.gacha-logo-block-double .image-preview {
  display: flex;
  justify-content: center;
  align-items: center;
}

/*
.intro-logo-block-double .intro-logo-image {
  height: 300px;
  width: auto;
  margin: 0 6px;
}
*/

/* --------------------------------------------
   左右ナビゲーションボタン（手動時のみ表示）
-------------------------------------------- */
.intro-nav-button,
.gacha-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(30, 30, 30, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  z-index: 10;
  transition: background-color 0.3s;
}

.intro-nav-button:hover,
.gacha-nav-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* 左右それぞれの位置調整 */
.intro-nav-button.left,
.gacha-nav-button.left {
  left: 10px;
}

.intro-nav-button.right,
.gacha-nav-button.right {
  right: 10px;
}

/* トグルスイッチ本体 */
.intro-toggle,
.gacha-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.intro-toggle {
  margin: 10px auto;
}

.gacha-toggle {
  margin: 5px;
}

.intro-toggle input[type="checkbox"],
.gacha-toggle input[type="checkbox"] {
  width: 40px;
  height: 20px;
  appearance: none;
  background-color: #ccc;
  border-radius: 10px;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background-color 0.3s;
}

.intro-toggle input[type="checkbox"]:checked,
.gacha-toggle input[type="checkbox"]:checked {
  background-color: #4caf50;
}

.intro-toggle input[type="checkbox"]::before,
.gacha-toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #fff;
  top: 1px;
  left: 1px;
  transition: transform 0.3s;
}

.intro-toggle input[type="checkbox"]:checked::before,
.gacha-toggle input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

/* --------------------------------------------
   トグルラベル（ON/OFF表示用）
-------------------------------------------- */
.intro-toggle label,
.gacha-toggle label {
  font-size: 14px;
  color: #333;
  user-select: none;
}

/* --------------------------------------------
   補足: 画像プレビュー領域の中に
   既存 .watermark-overlay を重ねる際の保護層
-------------------------------------------- */
.intro-slide-group .watermark-overlay,
.gacha-slide-group .watermark-overlay {
  position: absolute;
  top: 0;
  left: 0;

  /* === 修正: スライド高さを強制しないよう余白縮小 === */
  width: 95%;
  height: 95%;
  /* === 修正 === */

  opacity: 0.35;
  pointer-events: none;
}

/* Intro スライド画像比率補正    */
.intro-logo-image,
.intro-main-image {
  width: auto !important;
  max-width: var(--image_width);
  height: auto !important;
  max-height: 90vh;
  /* 画面の高さを超えないようにする */
  object-fit: contain;
  display: block;
  margin: 0 auto;
}


.accordion-scope .accordion-item {
  border: 1px solid #aaa;
  border-radius: 6px;
  margin: 6px 0;
  background-color: #fafafa;
  overflow: hidden;
}

/* --- ヘッダー部（クリック対象） --- */
.accordion-scope .accordion-header {
  display: block;
  width: 100%;
  text-align: left;
  background-color: #aaf5cc;
  font-weight: bold;
  padding: 10px 12px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background-color 0.25s ease;
}

/* ホバーとアクティブ状態 */
.accordion-scope .accordion-header:hover {
  background-color: #aaf5cc;
}

.accordion-scope .accordion-header.active {
  background-color: #bcffdd;
}

/* --- コンテンツ部（開閉領域） --- */
.accordion-scope .accordion-content {
  max-height: 0;
  overflow: hidden;
  background-color: #ffffff;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 12px;
}

/* activeクラスが付与された場合、内容を展開 */
.accordion-scope .accordion-header.active+.accordion-content {
  max-height: 2000px;
  /* 高さは大きめで上限超え防止 */
  padding: 10px 12px 12px 12px;
}

/* --- data-default-open="true" の初期開封 --- */
.accordion-item[data-default-open="true"]>.accordion-header {
  background-color: #aaf5cc;
}

.accordion-item[data-default-open="true"]>.accordion-content {
  max-height: 2000px;
  padding: 10px 12px 12px 12px;
}

.info-live-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  border: 2px solid #ccc;
}

.info-live-th {
  background: linear-gradient(to bottom, #fff9c4, #fffde7);
  color: #333;
  text-align: center;
  padding: 5px;
  border: 1px solid #bbb;
  font-weight: bold;
}

.info-live-top,
.info-live-center,
.info-live-left {
  background: linear-gradient(to bottom, #fff9c4, #fffde7);
  text-align: center;
  border: 1px solid #bbb;
  font-weight: bold;

}

.font-big {
  font-size: 20pt;
  color: gold;
  -webkit-text-stroke: 1px #ff0000;
  /*ベンダープレフィックス*/
}

.info-live-left {
  text-align: left;
}

.info-live-center {
  text-align: center;
}

.info-live-right {
  background: linear-gradient(to bottom, #fff8dc, #fffff0);
  text-align: right;
  border: 1px solid #ccc;
  padding: 5px;
}

/* 曜日別 */
.info-live-th.sat {
  color: blue;
}

.info-live-th.sun {
  color: red;
}

.info-live-th.mon {
  color: darkorange;
  text-shadow: 1px 1px 0 white, -1px -1px 0 white;
}

/* hover/focus 明度アップ */
.info-live-th:hover,
.info-live-th:focus,
.info-live-center:hover,
.info-live-center:focus,
.info-live-right:focus,
.info-live-right:hover {
  color: white;
  background-image: linear-gradient(to bottom, orange, tomato);
  transition: background-image 0.5s ease-in-out;
}

/* 今日の日付 */
.info-live-th.today-col,
.info-live-td.today-col {
  background-color: #f4a460 !important;
  transition: background-color 0.3s ease-in-out;
}

.info-live-th.hover-col,
.info-live-td.hover-col {
  background-color: #ffd700 !important;
  /* マウスフォーカス列 */
  transition: background-color 0.2s ease-in-out;
}