/* ============================================================
   Buddy Official Style Dashboard CSS
   Pixel-perfect Recreation of ProBot Official UI
   ============================================================ */

:root {
  --bg-main: #1f222d;
  --bg-topbar: #171822;
  --bg-guildbar: #161720;
  --bg-sidebar: #1f222d;
  --bg-card: #262934;
  --bg-card-hover: #2c303d;
  --bg-input: #2a2d39;
  --bg-input-focus: #313543;
  --bg-button-subtle: #2f3342;
  --bg-button-subtle-hover: #3a3f52;

  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-focus: #5865f2;

  --primary-blurple: #5865f2;
  --primary-blurple-hover: #4752c4;
  --primary-green: #10b981;
  --primary-green-hover: #059669;

  --badge-pink: #ec4899;
  --badge-gold: #f59e0b;

  --text-white: #ffffff;
  --text-primary: #f3f4f6;
  --text-muted: #8e93a3;
  --text-dark-muted: #626777;

  --font-family: 'Outfit', 'Inter', 'Noto Sans JP', sans-serif;
  --font-heading: 'Outfit', 'Inter', 'Noto Sans JP', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.probot-theme {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   1. トップバー (Top Bar)
   ============================================================ */
.probot-topbar {
  height: 54px;
  background-color: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  flex-shrink: 0;
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.probot-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.logo-box {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-p {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  line-height: 1;
}

.logo-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-link-item {
  color: #a0a5b5;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.18s;
}

.topbar-link-item:hover {
  color: #ffffff;
}

.topbar-link-item .link-icon {
  font-size: 0.95rem;
}

.topbar-link-item:first-child .link-icon {
  color: #818cf8;
}

.topbar-link-item:nth-child(2) .link-icon {
  color: #60a5fa;
}

.lang-flag-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-flag-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* モバイル用ナビゲーションハンバーガーボタン */
.btn-topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-topbar-hamburger:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* モバイルトップバードロワーオーバーレイ */
.topbar-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.topbar-drawer-overlay.open {
  display: block;
  opacity: 1;
}

/* モバイル用トップバー右スライドドロワーメニュー */
.topbar-mobile-dropdown {
  position: fixed;
  top: 0;
  right: 0;
  width: 290px;
  max-width: 85vw;
  height: 100vh;
  background: #171822;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 20px;
  flex-direction: column;
  gap: 10px;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
}

.topbar-mobile-dropdown.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-drawer {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-close-drawer:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.mobile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s;
}

.mobile-dropdown-item:hover, .mobile-dropdown-item:active {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.mobile-dropdown-item.pro-link {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.25);
  color: #facc15;
}

.mobile-dropdown-item .dropdown-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 認証ボタン & アバター */
.btn-discord-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-blurple);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.btn-discord-login:hover {
  background: var(--primary-blurple-hover);
}

.discord-svg-icon {
  width: 16px;
  height: 16px;
}

.header-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.user-avatar-mini {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.user-name-mini {
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-logout-link {
  color: var(--text-dark-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 4px;
  transition: color 0.2s;
}

.btn-logout-link:hover {
  color: #f43f5e;
}

/* ============================================================
   2. 全体レイアウト (3カラム)
   ============================================================ */
.probot-layout-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 54px);
  overflow: hidden;
}

/* ------------------------------------------------------------
   2-1. 最左カラム: ギルドアイコンバー (Discordスタイル)
   ------------------------------------------------------------ */
.guild-sidebar {
  width: 72px;
  background-color: var(--bg-guildbar);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
}

.guild-sidebar-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.guild-separator {
  width: 32px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  margin: 4px 0;
}

.guild-icon-wrapper {
  position: relative;
  width: 72px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.guild-pill {
  position: absolute;
  left: 0;
  width: 4px;
  height: 0;
  background-color: #ffffff;
  border-radius: 0 4px 4px 0;
  transition: height 0.2s ease;
}

.guild-icon-wrapper:hover .guild-pill {
  height: 20px;
}

.guild-icon-wrapper.active .guild-pill {
  height: 38px;
}

.guild-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #242733;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  user-select: none;
}

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

.guild-icon-wrapper:hover .guild-icon,
.guild-icon-wrapper.active .guild-icon {
  border-radius: 16px;
  background-color: var(--primary-blurple);
}

.home-icon {
  background-color: #292d3b;
}

.discord-logo-icon {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.add-server-icon {
  color: #10b981;
  background-color: #20232c;
  font-size: 1.4rem;
}

.guild-icon-wrapper:hover .add-server-icon {
  background-color: #10b981;
  color: #fff;
}

/* ------------------------------------------------------------
   2-2. サーバーアイコンの右側: モジュールリストサイドバー (添付画像完全一致)
   ------------------------------------------------------------ */
.modules-sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  flex-shrink: 0;
  padding: 18px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.modules-list-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.module-nav-item {
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  color: var(--text-muted);
}

.module-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

/* 添付画像のアクティブピルハイライト (Music) */
.module-nav-item.active {
  background-color: var(--primary-blurple);
  color: #ffffff;
}

.module-nav-item.active .mod-label {
  color: #ffffff;
  font-weight: 600;
}

.mod-icon {
  font-size: 1.1rem;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mod-label {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* 緑色のチェックマーク丸バッジ (添付画像右端の ✓) */
.mod-check-badge {
  margin-left: auto;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background-color: var(--primary-green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

/* NEW バッジ & Premium バッジ (ラベルのすぐ横に配置) */
.mod-pill-badge {
  margin-left: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.4;
  flex-shrink: 0;
}

.badge-new {
  background-color: var(--badge-pink);
  color: #ffffff;
}

.badge-premium,
.badge-pro {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.25) 0%, rgba(234, 179, 8, 0.15) 100%);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: #facc15;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Buddy Pro 限定機能ロックバナー */
.pro-locked-banner {
  margin-bottom: 24px;
  padding: 24px 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.15) 0%, rgba(88, 101, 242, 0.1) 100%);
  border: 2px solid rgba(250, 204, 21, 0.4);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.25s ease-out;
}

.pro-locked-banner .banner-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 10px;
}

.pro-locked-banner .banner-title {
  margin: 0 0 8px 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
}

.pro-locked-banner .banner-desc {
  margin: 0 0 18px 0;
  color: #cbd5e1;
  font-size: 0.92rem;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.pro-locked-banner .btn-pro-upgrade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  padding: 11px 26px;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  color: #0f1013;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(250, 204, 21, 0.35);
  transition: all 0.2s ease;
}

.pro-locked-banner .btn-pro-upgrade:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* OTHERS サブ見出し */
.modules-subgroup-title {
  padding: 16px 14px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dark-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.arrow-down {
  font-size: 0.8rem;
  color: var(--text-dark-muted);
}

/* ------------------------------------------------------------
   2-3. メイン設定エリア (添付画像右側完全一致)
   ------------------------------------------------------------ */
.dashboard-main-area {
  flex: 1;
  background-color: var(--bg-main);
  padding: 32px 48px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ヘッダー: モジュール名 & 大型トグルスイッチ */
.module-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.module-view-title {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* 大型トグルスイッチ (添付画像の巨大な緑色スイッチ) */
.probot-switch {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 32px;
  flex-shrink: 0;
}

.probot-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.probot-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #383c4b;
  transition: background-color 0.25s ease;
  border-radius: 34px;
}

.probot-switch .slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 4px;
  background-color: #ffffff;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.probot-switch input:checked + .slider {
  background-color: var(--primary-green);
}

.probot-switch input:checked + .slider:before {
  transform: translateX(26px);
}

/* 未ログイン・警告バー */
.oauth-status-banner {
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.oauth-status-banner .alert-icon { font-size: 1.5rem; }
.oauth-status-banner .alert-content strong { display: block; font-size: 0.95rem; color: #c7d2fe; }
.oauth-status-banner .alert-content p { font-size: 0.84rem; color: #a5b4fc; }

.btn-banner-login {
  margin-left: auto;
  background: var(--primary-blurple);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ============================================================
   3. パネル切り替え & 共通フォーム要素
   ============================================================ */
.module-content-panel {
  display: none;
  animation: fadeIn 0.18s ease-out forwards;
}

.module-content-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-sub-block {
  margin-bottom: 24px;
}

.field-label-probot {
  font-size: 0.75rem;
  font-weight: 700;
  color: #727788;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.section-sub-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ドロップダウン (DJ ROLES セレクター等) */
.select-dropdown-container {
  position: relative;
  width: 100%;
}

.probot-select-field {
  width: 100%;
  height: 44px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #a2a8b8;
  padding: 0 40px 0 16px;
  font-family: var(--font-family);
  font-size: 0.92rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238e93a3' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.probot-select-field:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-input-focus);
}

/* ============================================================
   4. コマンドカード一覧 (添付画像完全一致)
   ============================================================ */
.command-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.probot-cmd-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.15s ease;
}

.probot-cmd-card:hover {
  background-color: var(--bg-card-hover);
}

.cmd-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cmd-name-title {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.cmd-sub-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.cmd-action-col {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* ⌥ Edit ボタン */
.btn-probot-edit {
  background-color: var(--bg-button-subtle);
  color: #dcdee4;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-family);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-probot-edit:hover {
  background-color: var(--bg-button-subtle-hover);
  color: #ffffff;
}

.btn-probot-edit .edit-icon {
  font-size: 0.95rem;
}

/* ミニトグルスイッチ (Blurple色、添付画像完全一致) */
.probot-mini-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
}

.probot-mini-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.probot-mini-switch .mini-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #383c4b;
  transition: background-color 0.22s ease;
  border-radius: 24px;
}

.probot-mini-switch .mini-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.probot-mini-switch input:checked + .mini-slider {
  background-color: var(--primary-blurple);
}

.probot-mini-switch input:checked + .mini-slider:before {
  transform: translateX(22px);
}

/* ============================================================
   5. その他のモジュール向けインプット & フォーム
   ============================================================ */
.probot-input-field, .probot-textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.probot-input-field:focus, .probot-textarea:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-input-focus);
}

.add-responder-box {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-probot-primary {
  background-color: var(--primary-blurple);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-probot-primary:hover {
  background-color: var(--primary-blurple-hover);
}

.btn-probot-primary:active {
  transform: scale(0.98);
}

.form-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-sub-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.action-btn-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 14px;
}

/* テーブル */
.heading-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-container {
  overflow-x: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.probot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.probot-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  text-align: left;
  color: var(--text-dark-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
}

.probot-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.empty-row {
  text-align: center;
  padding: 30px;
  color: var(--text-dark-muted);
}

.btn-danger-del {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-danger-del:hover {
  background: rgba(244, 63, 94, 0.25);
}

/* スラッシュコマンドリスト */
.commands-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.cmd-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cmd-block code {
  color: #a5b4fc;
  font-weight: 600;
  font-size: 0.9rem;
}

.cmd-block span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* トースト通知シェルフ */
.toast-shelf {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast-msg {
  background: #252835;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  animation: slideToast 0.24s ease;
}

.toast-msg.success { border-left: 4px solid var(--primary-green); }
.toast-msg.error { border-left: 4px solid #f43f5e; }

@keyframes slideToast {
  from { transform: translateX(80px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* カスタムスクロールバー */
* {
  scrollbar-width: thin;
  scrollbar-color: #2b2e38 transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2b2e38;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3b3f4d;
}

/* ============================================================
   言語切り替え & モーダル (Support / Invite / Tickets)
   ============================================================ */
.lang-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  transition: all 0.2s ease;
  user-select: none;
}

.lang-flag-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* モーダルオーバーレイ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 16, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* モーダルカード */
.modal-card {
  width: 100%;
  max-width: 580px;
  background: #171923;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-card-large {
  max-width: 760px;
}

.modal-header {
  padding: 22px 28px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #949ba4;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.modal-body {
  padding: 24px 28px;
  max-height: 72vh;
  overflow-y: auto;
  color: #dbdee1;
  font-size: 0.92rem;
  line-height: 1.6;
}

.modal-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s, background-color 0.2s;
}

.modal-section:hover {
  border-color: rgba(88, 101, 242, 0.4);
  background: rgba(88, 101, 242, 0.04);
}

.modal-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-section-desc {
  font-size: 0.86rem;
  color: #949ba4;
  margin-bottom: 14px;
}

.modal-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-brand-discord {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}

.btn-brand-discord:hover {
  background: #4752c4;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.45);
}

.btn-brand-osiris {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-brand-osiris:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.btn-brand-web {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-brand-web:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* 機能紹介カードグリッド */
.features-intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.feature-intro-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature-intro-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.feature-intro-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.feature-intro-desc {
  font-size: 0.82rem;
  color: #949ba4;
  line-height: 1.5;
}

.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================================
   20. 変数タグヘルパー (Variable Tags Helper)
   ============================================================ */
.variable-helper-shelf {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.var-helper-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.var-helper-icon {
  font-size: 0.85rem;
}

.var-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.var-tag-pill {
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.28);
  color: #c7d2fe;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.var-tag-pill:hover {
  background: var(--primary-blurple);
  color: #ffffff;
  border-color: var(--primary-blurple);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.35);
}

.var-tag-pill:active {
  transform: scale(0.96);
}

.var-tag-pill .var-tag-desc {
  font-size: 0.7rem;
  opacity: 0.75;
  font-family: var(--font-family);
  font-weight: 400;
}

/* ============================================================
   21. 検索フィルター付きカスタムドロップダウン (Searchable Select)
   ============================================================ */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

/* 元のネイティブ select を非表示にして背後に置く */
.custom-select-wrapper select.probot-select-field {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
  padding: 0;
  margin: 0;
  border: none;
}

.custom-select-trigger {
  width: 100%;
  height: 44px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  padding: 0 14px;
  font-family: var(--font-family);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.18s, background-color 0.18s, box-shadow 0.18s;
  user-select: none;
}

.custom-select-trigger:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background-color: var(--bg-card-hover);
}

.custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--border-focus);
  background-color: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.custom-select-trigger-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger-icon {
  font-size: 1rem;
  color: #949ba4;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-select-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger-label.placeholder {
  color: #727788;
}

.custom-select-chevron {
  color: #8e93a3;
  transition: transform 0.22s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.custom-select-wrapper.open .custom-select-chevron {
  transform: rotate(180deg);
  color: var(--primary-blurple);
}

/* ポップオーバーメニュー */
.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 999;
  background: #1e212b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.25);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  backdrop-filter: blur(16px);
}

.custom-select-wrapper.open .custom-select-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 検索ボックス */
.custom-select-search-box {
  display: flex;
  align-items: center;
  background: #272a38;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  gap: 8px;
  transition: border-color 0.15s;
}

.custom-select-search-box:focus-within {
  border-color: var(--border-focus);
}

.custom-select-search-box .search-icon {
  font-size: 0.85rem;
  opacity: 0.6;
}

.custom-select-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.86rem;
}

.custom-select-search-input::placeholder {
  color: #727788;
}

.custom-select-search-clear {
  background: none;
  border: none;
  color: #8e93a3;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 2px;
}

.custom-select-search-clear:hover {
  color: #ffffff;
}

/* オプションリスト */
.custom-select-options-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 4px;
}

/* スクロールバー装飾 */
.custom-select-options-list::-webkit-scrollbar {
  width: 5px;
}
.custom-select-options-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.custom-select-option {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  color: #c4c8d4;
  transition: background-color 0.12s, color 0.12s;
  user-select: none;
}

.custom-select-option:hover {
  background-color: var(--primary-blurple);
  color: #ffffff;
}

.custom-select-option.selected {
  background-color: rgba(88, 101, 242, 0.2);
  color: #93a4f8;
  font-weight: 600;
}

.custom-select-option.selected:hover {
  background-color: var(--primary-blurple);
  color: #ffffff;
}

.custom-select-option-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opt-prefix {
  font-size: 0.95rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.role-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.opt-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opt-check {
  font-size: 0.85rem;
  color: var(--primary-green);
  opacity: 0;
}

.custom-select-option.selected .opt-check {
  opacity: 1;
}

.custom-guild-avatar-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #2b2d31;
}

.custom-guild-avatar-fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #35373c;
  color: #dbdee1;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-select-no-results {
  padding: 16px 12px;
  text-align: center;
  color: #727788;
  font-size: 0.84rem;
}

/* ============================================================
   22. NGワード編集ドロワー (Animated Badwords Drawer)
   ============================================================ */
.badwords-card-container {
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 0 !important;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.badwords-card-container.expanded {
  border-color: rgba(88, 101, 242, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.probot-cmd-card-main {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-toggle-badwords {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-toggle-badwords .chevron-icon {
  transition: transform 0.25s ease;
}

.badwords-card-container.expanded .btn-toggle-badwords .chevron-icon {
  transform: rotate(180deg);
}

.badwords-card-container.expanded .btn-toggle-badwords {
  background-color: var(--primary-blurple);
  color: #ffffff;
  border-color: var(--primary-blurple);
}

.badwords-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, border-color 0.25s ease;
  background: rgba(18, 20, 27, 0.85);
  border-top: 1px solid transparent;
}

.badwords-drawer.open {
  max-height: 600px;
  opacity: 1;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.badwords-drawer-inner {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badwords-count-badge {
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* チップ一覧コンテナ */
.badwords-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  min-height: 64px;
  align-items: center;
}

.badwords-empty-hint {
  font-size: 0.84rem;
  color: #727788;
  font-style: italic;
  width: 100%;
  text-align: center;
}

.badword-chip {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #fca5a5;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: chipAppear 0.18s ease-out forwards;
}

@keyframes chipAppear {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.badword-chip-remove {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.15s, transform 0.15s;
}

.badword-chip-remove:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* 新規追加フォーム */
.badwords-add-bar {
  display: flex;
  gap: 10px;
}

.badwords-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.badwords-input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  pointer-events: none;
}

.badwords-input-wrapper input {
  padding-left: 42px !important;
}

/* フッター操作バー */
.drawer-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

.drawer-hint-text {
  font-size: 0.78rem;
  color: #727788;
}

/* ============================================================
   アカウントドロップダウンメニュー (ヘッダー右上)
   ============================================================ */
.account-menu-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: #181920;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 8px;
  z-index: 1000;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.account-menu-header {
  padding: 10px 12px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.account-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.account-menu-item.logout-item:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.account-menu-item .menu-icon {
  font-size: 1.1rem;
}

/* ============================================================
   Stripe Buy Button 幅100% フィット
   ============================================================ */
.stripe-buy-container,
.stripe-vip-embed {
  width: 100% !important;
  display: block !important;
  box-sizing: border-box !important;
}

stripe-buy-button {
  width: 100% !important;
  display: block !important;
  min-width: 100% !important;
  box-sizing: border-box !important;
}

/* ============================================================
   サーバー選択画面 (Server Selection Grid)
   ============================================================ */
.server-selection-header {
  margin-bottom: 24px;
}
.server-selection-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px 0;
}
.server-selection-desc {
  color: #94a3b8;
  font-size: 0.95rem;
  margin: 0;
}

.server-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.server-card-select-item {
  background: #181920;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.server-card-select-item:hover {
  border-color: #5865f2;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.2);
  background: #1e1f29;
}

.server-card-select-item.is-active-server {
  border-color: #facc15;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.08) 0%, #181920 100%);
}

.server-card-select-item.is-active-server::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #facc15;
}

.server-select-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.server-select-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
}

.server-select-details {
  flex: 1;
  min-width: 0;
}

.server-select-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-select-members {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.server-select-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  background: #5865f2;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.server-select-btn:hover {
  background: #4752c4;
}

/* ============================================================
   スマホ・タブレット向けレスポンシブUI最適化 (Mobile Responsive)
   ============================================================ */
.btn-mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  margin-right: 10px;
}

@media (max-width: 900px) {
  .btn-mobile-menu {
    display: inline-flex;
  }

  .topbar-links {
    display: none !important;
  }

  .btn-topbar-hamburger {
    display: inline-flex !important;
  }

  .guild-sidebar {
    width: 56px !important;
    min-width: 56px !important;
  }

  .guild-icon-wrapper {
    width: 42px !important;
    height: 42px !important;
  }

  .guild-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 0.9rem;
  }

  /* モジュールサイドバーをモバイルドロワー化 */
  .modules-sidebar {
    position: fixed;
    top: 54px;
    left: 0;
    bottom: 0;
    width: 270px;
    background: #14151b;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
    z-index: 850;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
  }

  .modules-sidebar.mobile-open {
    display: flex !important;
    transform: translateX(0);
  }

  .dashboard-main-area {
    padding: 16px 14px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .module-view-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .module-view-title {
    font-size: 1.4rem;
  }

  .form-row-2col {
    grid-template-columns: 1fr !important;
  }

  .server-selection-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .probot-topbar {
    padding: 10px 14px;
    position: relative;
  }

  .topbar-right {
    gap: 10px;
  }

  .logo-title {
    font-size: 1.15rem;
  }

  .topbar-links {
    display: none !important;
  }

  .btn-topbar-hamburger {
    display: inline-flex !important;
  }

  .oauth-status-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px 16px !important;
  }

  .oauth-status-banner .btn-banner-login {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .probot-form-card {
    padding: 16px;
  }

  .section-sub-block {
    margin-bottom: 14px;
  }

  .btn-probot-primary,
  .btn-probot-edit {
    width: 100%;
    justify-content: center;
  }

  .server-card-select-item {
    padding: 16px;
  }

  .account-menu-popover {
    right: -10px;
    width: calc(100vw - 30px);
    max-width: 280px;
  }
}

/* ==========================================================================
   XP & RP システム / クーポン交換所 / 広告モーダル スタイル
   ========================================================================== */

/* 2大区分ナビゲーション (XP機能解放 vs RPリワード交換所) */
.level-system-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.level-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.level-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.level-tab-btn.active {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.25) 0%, rgba(88, 101, 242, 0.1) 100%);
  border-color: rgba(88, 101, 242, 0.5);
  color: #fff;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.2);
}

.level-tab-btn.tab-gold.active {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2) 0%, rgba(234, 179, 8, 0.08) 100%);
  border-color: rgba(250, 204, 21, 0.5);
  color: #facc15;
  box-shadow: 0 4px 15px rgba(250, 204, 21, 0.15);
}

/* RPダッシュボード ヘッダーカード */
.rp-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.12) 0%, rgba(234, 179, 8, 0.04) 50%, rgba(88, 101, 242, 0.08) 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.35);
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
  gap: 20px;
}

.rp-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.rp-gem-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(250, 204, 21, 0.3);
}

.rp-hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px 0;
}

.rp-hero-desc {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin: 0;
  max-width: 500px;
  line-height: 1.5;
}

.rp-balance-badge {
  text-align: right;
  background: rgba(0, 0, 0, 0.35);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.rp-balance-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  display: block;
}

.rp-balance-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: #facc15;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* RP獲得アクションカードグリッド */
.rp-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.rp-action-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.rp-action-box:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.rp-action-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.rp-action-icon {
  font-size: 2rem;
  line-height: 1;
}

.rp-action-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
}

.rp-action-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.rp-reward-amount-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 6px;
}

.btn-rp-action {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-rp-daily {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-rp-daily:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
}

.btn-rp-daily:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-rp-ad {
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

.btn-rp-ad:hover:not(:disabled) {
  background: linear-gradient(135deg, #6b77f5 0%, #5865f2 100%);
  transform: translateY(-1px);
}

.btn-rp-ad:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* クーポン交換所グリッド */
.coupon-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 14px;
  margin-bottom: 30px;
}

.coupon-shop-card {
  position: relative;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.coupon-shop-card:hover {
  transform: translateY(-4px);
  border-color: rgba(250, 204, 21, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.coupon-shop-card.featured-free {
  border-color: rgba(250, 204, 21, 0.6);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.08) 0%, rgba(18, 20, 29, 0.95) 100%);
}

.coupon-shop-card.featured-free::before {
  content: "★ 1ヶ月無料 ★";
  position: absolute;
  top: 12px;
  right: 12px;
  background: #facc15;
  color: #000;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.coupon-card-discount {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
  margin-bottom: 6px;
}

.coupon-card-discount span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #facc15;
}

.coupon-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0 0 10px 0;
}

.coupon-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.coupon-card-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}

.coupon-cost-label {
  font-size: 0.82rem;
  color: #94a3b8;
}

.coupon-cost-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #facc15;
}

.btn-exchange-coupon {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  color: #0f1013;
  box-shadow: 0 4px 15px rgba(250, 204, 21, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-exchange-coupon:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-exchange-coupon:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

/* 所持クーポン一覧エリア */
.my-coupons-shelf {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px;
}

.my-coupons-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.my-coupons-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.coupon-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(250, 204, 21, 0.4);
  margin-bottom: 10px;
  gap: 16px;
  flex-wrap: wrap;
}

.coupon-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.coupon-item-code {
  font-family: 'Outfit', monospace;
  font-size: 1.1rem;
  font-weight: 800;
  color: #facc15;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  user-select: all;
}

.coupon-item-desc {
  font-size: 0.88rem;
  color: #cbd5e1;
}

.coupon-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 広告視聴シミュレーターモーダル */
.ad-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.ad-modal-content {
  background: #13141a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  width: 100%;
  max-width: 580px;
  padding: 30px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  position: relative;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ad-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.ad-sponsor-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.ad-media-showcase {
  background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 50%, #0f172a 100%);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: 14px;
  padding: 30px 24px;
  text-align: center;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.ad-media-showcase::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.ad-showcase-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px 0;
}

.ad-showcase-desc {
  font-size: 0.92rem;
  color: #cbd5e1;
  max-width: 440px;
  margin: 0 auto 16px auto;
  line-height: 1.5;
}

.ad-timer-progress-wrap {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.ad-timer-progress-bar {
  background: linear-gradient(90deg, #5865f2, #facc15);
  height: 100%;
  width: 0%;
  transition: width 0.1s linear;
}

.ad-timer-countdown-text {
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 18px;
  font-weight: 600;
}

.ad-timer-countdown-text span {
  color: #facc15;
  font-weight: 800;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}




