@import url(https://fonts.googleapis.com/css2?family=Rampart+One&display=swap);
@import url(https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap);
/*スクロールバー非表示（Chrome・Safari）*/
body::-webkit-scrollbar{
  display:none;
}

.App {
  /*スクロールバー非表示（IE・Edge）*/
  -ms-overflow-style: none;
  /*スクロールバー非表示（Firefox）*/
  scrollbar-width: none;
  text-align: center;
}

.App-logo {
  text-decoration: none;
  color: #000;
}
.App-logo:hover {
  color: #000;
}

.App-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: calc(10px + 2vmin);
}

.App-link {
  color: #61dafb;
}

.list-item {
  cursor: pointer;
}
.list-item:hover {
  background-color: #CCCCCC;
  color: #000;
}
body.dark-theme {
  --bg-color:  #333;
  --text-color:  #ddd;
  --header-bg-color:  #222;
}
.stamp:hover {
  border: 5px solid orange;
  transition: 0.1s;
  scale: 1.3;
  z-index: 2;
}
.zoom-stamp:hover {
  transition: 0.1s;
  scale: 1.5;
  z-index: 2;
}
a:hover {
  text-decoration: none;
}
a,a:hover {
  color: #555;
}
@media (prefers-color-scheme: darks) {
  body {
    background-color: #121212;
    color: #eee;
  }
  a,a:hover {
    color: #eee;
  }
.bg{background-color: rgba(255, 255, 255, .10);}
}
.my-masonry-grid {
  display: flex;
  margin-left: -5px; /* 項目間の余白のサイズ */
  width: auto;
}
.my-masonry-grid_column {
  padding-left: 5px; /* 項目間の余白のサイズ */
  background-clip: padding-box;
}
.my-masonry-grid_column > .event-card {
  margin-bottom: 5px;
}
.cropper-container {
  z-index: 3;
}
.file-add {
  transition: 0.2s;
}
.file-add:hover {
  background-color: #555555;
  color: #DDDDDD;
  transition: 0.2s;
}
.thumbnail-overlay {
  position:"absolute";
  width:"100%";
  height:"100%";
  border:"1px solid red";
  opacity: 0.1
}
.thumbnail-overlay:hover {
  opacity: 1
}
.chat-you {
  position:"absolute";
  left:0;
}
.chat-me {
  position:"absolute";
  right:0;
}
.white {
  color: #FFFFFF;
  text-decoration: none
}
.white:hover {
  color: #FFFFFF
}
.link:hover {
  cursor: pointer;
  text-decoration: underline;
}
#menu-header::-webkit-scrollbar{
  display: none;
}
#category-bar::-webkit-scrollbar{
  display: none;
}
#tag-bar::-webkit-scrollbar{
  display: none;
}
.thumbnail-bar::-webkit-scrollbar{
  display: none;
}
.dropdown-toggle::after {
  display: none;
}
.required {
  color:white;
  background-color:#F14668;
  border-radius: 5px;
  font-size: 10px;
  padding: 3px;
}
.mousewrap {
  overflow: scroll;
  display: inline-block;
}
.fix-list {
  top: 100px
}

.touchnone {
  touch-action: none;
}
.cp_ribbon05 {
	position: absolute;
	top: -6px;
	right: -6px;
	overflow: hidden;
	width: 108px;
	height: 108px;
  z-index: 1;
}
.cp_ribbon05 .cp_ribbon {
	font-size: 1em;
	line-height: 1.2em;
	position: relative;
	top: 26px;
	left: -4px;
	width: 150px;
	padding: 7px 0;
	-webkit-transform: rotate(45deg);
	        transform: rotate(45deg);
	text-align: center;
	letter-spacing: 0.5px;
	color: #333333;
	color: #ffffff;
	border: 1px dashed #ffffff;
	box-shadow: 0px 0px 0px 3px #E29514;
	background-color: #FDCC00;
}
.cp_ribbon05 .cp_ribbon:before, .cp_ribbon05 .cp_ribbon:after {
	position: absolute;
	bottom: -8px;
	content: '';
	border-width: 4px 4px 0 4px;
	border-style: solid;
	border-color: brown transparent transparent transparent;
}
.cp_ribbon05 .cp_ribbon:before {
	left: -4px;
}
.cp_ribbon05 .cp_ribbon:after {
	right: 3px;
}
.hidden,.mute {
  display:none;
}
.balloon2-left {
  position: relative;
  display: inline-block;
  margin: 1.5em 0 1.5em 15px;
  padding: 7px 10px;
  min-width: 120px;
  max-width: 100%;
  color: #555;
  font-size: 16px;
  background: #FFF;
  border: solid 3px #555;
  box-sizing: border-box;
}

.balloon2-left:before {
  content: "";
  position: absolute;
  top: 50%;
  left: -24px;
  margin-top: -12px;
  border: 12px solid transparent;
  border-right: 12px solid #FFF;
  z-index: 2;
}

.balloon2-left:after {
  content: "";
  position: absolute;
  top: 50%;
  left: -30px;
  margin-top: -14px;
  border: 14px solid transparent;
  border-right: 14px solid #555;
  z-index: 1;
}

.balloon2-left p {
  margin: 0;
  padding: 0;
}
.simple-table th {
  font-weight: normal;
}
.grey {
  color: #555555;
}
.style-selector {
  cursor: pointer;
}
.style-selector:hover {
  border: 1px solid #555555;
  transition: 0.1s;
  opacity: 0.5;
}
/* SettingPopup.css - 設定ポップアップのスタイル */

/* タブナビゲーションの改善 */
.nav-pills .nav-link {
  border-radius: 0;
  margin: 0;
  padding: 12px 16px;
  font-weight: 500;
  transition: all 0.15s ease;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  background-color: transparent;
}

.nav-pills .nav-link:hover {
  background-color: #f9fafb;
  color: #374151;
}

.nav-pills .nav-link.active {
  background-color: transparent;
  border-bottom: 2px solid #3b82f6;
  color: #3b82f6;
  box-shadow: none;
}

/* タブコンテンツのスタイル */
.tab-content {
  border: none;
  padding: 0;
}

.tab-pane {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* カードスタイルの改善 */
.card {
  transition: all 0.3s ease;
  border: 1px solid #dee2e6 !important;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* フォームコントロールの改善 */
.form-control, .form-select {
  border-radius: 8px !important;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ボタンの改善 */
.btn {
  border-radius: 8px !important;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* トグルボタンの改善 */
.btn-check:checked + .btn-outline-primary {
  background-color: #007bff;
  border-color: #007bff;
}

/* チップスタイルの改善 */
.MuiChip-root {
  transition: all 0.3s ease !important;
  border-radius: 12px !important;
}

.MuiChip-root:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* 画像コンテナの改善 */
.image-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.image-container img {
  transition: transform 0.3s ease;
}

.image-container:hover img {
  transform: scale(1.05);
}

/* アラートボックスの改善 */
.alert {
  border: none;
  border-radius: 12px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-info {
  background-color: #e7f3ff !important;
  color: #0c5460 !important;
}

/* セクションヘッダーの改善 */
.section-header {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(45deg, #007bff, #0056b3);
  border-radius: 2px;
}

/* プログレスバーの改善 */
.progress {
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  transition: width 0.6s ease;
}

/* スクロールバーの改善 */
.overflow-auto::-webkit-scrollbar {
  width: 8px;
}

.overflow-auto::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.overflow-auto::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.overflow-auto::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  .nav-pills .nav-link {
    padding: 8px 12px;
    margin: 0 2px;
    font-size: 14px;
  }
  
  .card-body {
    padding: 16px !important;
  }
  
  .btn {
    font-size: 14px;
  }
  
  h3 {
    font-size: 24px !important;
  }
  
  h5 {
    font-size: 18px !important;
  }
}

@media (max-width: 576px) {
  .nav-pills {
    padding: 4px 8px !important;
  }
  
  .nav-pills .nav-link {
    padding: 6px 8px;
    margin: 0 1px;
    font-size: 12px;
  }
  
  .nav-pills .nav-link span {
    display: none !important;
  }
}

/* Loading spinner */
.spinner-border-sm {
  width: 1rem !important;
  height: 1rem !important;
}

/* バックドロップブラー効果 */
.backdrop-blur {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* 設定セクションのスタイル */
.setting-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.setting-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.setting-section-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f3f4f6;
}

.setting-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.setting-section-description {
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.setting-section-content {
  margin-top: 16px;
}

/* 危険な操作エリア */
.setting-danger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.setting-danger-item:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.setting-danger-title {
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 4px;
  font-size: 15px;
}

.setting-danger-description {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  .setting-danger-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .setting-section {
    padding: 16px;
  }
}

/* ImageCropper専用スタイル */

.image-cropper-overlay {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cropper-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
}

.crop-area {
  border: 2px solid #007bff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* ズームスライダーのカスタムスタイル */
.image-cropper-overlay .form-range {
  height: 6px;
  background: transparent;
  border-radius: 3px;
  outline: none;
  transition: all 0.2s ease;
}

.image-cropper-overlay .form-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007bff;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  transition: all 0.2s ease;
}

.image-cropper-overlay .form-range::-webkit-slider-thumb:hover {
  background: #0056b3;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  transform: scale(1.1);
}

.image-cropper-overlay .form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007bff;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  transition: all 0.2s ease;
}

.image-cropper-overlay .form-range::-moz-range-thumb:hover {
  background: #0056b3;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  transform: scale(1.1);
}

/* ボタンのホバーエフェクト */
.image-cropper-overlay .btn {
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-cropper-overlay .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-cropper-overlay .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-cropper-overlay .btn-primary {
  background: linear-gradient(45deg, #007bff, #0056b3);
}

.image-cropper-overlay .btn-primary:hover:not(:disabled) {
  background: linear-gradient(45deg, #0056b3, #004085);
}

.image-cropper-overlay .btn-secondary {
  background: linear-gradient(45deg, #6c757d, #545b62);
}

.image-cropper-overlay .btn-secondary:hover:not(:disabled) {
  background: linear-gradient(45deg, #545b62, #495057);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .image-cropper-overlay .btn {
    padding: 12px 16px !important;
    font-size: 14px !important;
    min-width: 80px !important;
  }
  
  .image-cropper-overlay .form-range::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }
  
  .image-cropper-overlay .form-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
}

/* アクセシビリティ対応 */
.image-cropper-overlay .btn:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.image-cropper-overlay .form-range:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* アニメーション */
.image-cropper-overlay {
  animation: fadeIn 0.2s ease-out;
}

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

/* コントロールパネルのアニメーション */
.image-cropper-overlay > div > div:last-child {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.fas-button-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 共通ボタンスタイル */
.fas-btn {
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* プライマリボタン（フォロー/支援） */
.fas-btn-primary {
    background: linear-gradient(135deg, #ff4d4d 0%, #f72585 100%);
    color: white;
    padding: 10px 24px;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.fas-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.4);
    background: linear-gradient(135deg, #ff5e5e 0%, #ff4d91 100%);
}

.fas-btn-primary:active {
    transform: translateY(0);
}

/* メンバー/支援アイコンの微調整 */
.fas-btn-icon {
    font-size: 1.1rem;
    margin-right: 8px;
}

/* アウトラインボタン（フォロー解除用） */
.fas-btn-outline {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #666;
    padding: 10px;
    width: 44px;
    height: 44px;
}

.fas-btn-outline:hover {
    background: #fff;
    color: #ff4d4d;
    border-color: rgba(255, 77, 77, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* フォローボタンのバリエーション（フォロー前） */
.fas-btn-follow {
    min-width: 140px;
}

/* プラン加入ボタン */
.fas-btn-join {
    min-width: 140px;
}

/* 支援ボタンのバリエーション（フォロー後） */
.fas-btn-support {
    min-width: 160px;
}

/* アイコンのみのボタン（プランがある場合のサポート等） */
.fas-btn-support-icon,
.fas-btn-unfollow {
    min-width: 44px;
}

/* アニメーション：ふわっと浮き出る */
@keyframes fas-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fas-button-container {
    animation: fas-fade-in 0.4s ease-out;
}
.image-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  user-select: none;
}

.image-content-wrapper {
  flex-grow: 1;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  position: relative;
  touch-action: none; /* ★★★ これを追加 ★★★ */
}

.image-content-wrapper img {
  max-width: 100%;  /* 初期表示でコンテナに収まるように */
  max-height: 100%;
  object-fit: contain; /* アスペクト比を保ってコンテナに収める */
  will-change: transform; /* パフォーマンス向上のヒント */
  transform-origin: 0 0; /* ★★★ これが重要！ JavaScriptの計算ロジックと一致させる ★★★ */
}

.image-preview-controls {
  padding: 10px 0;
  width: 100%;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.image-preview-controls button {
  padding: 8px 15px;
  background-color: #333;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.image-preview-controls button:hover {
  background-color: #444;
}

.image-preview-controls span {
  color: white;
  font-size: 0.9rem;
}
/* Home.css - Home画面専用のプレミアムデザイン定義 */

.home-premium-vars {
    /* Premium Design Tokens - Smart & Subtle */
    --premium-blue: #475569;
    --premium-purple: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --premium-shadow: 0 4px 20px 0 rgba(15, 23, 42, 0.1);
    --surface-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

.home-section-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--premium-blue, #475569), var(--premium-purple, #1e293b));
    color: white;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    font-size: 24px;
    flex-shrink: 0;
}

.home-section-title {
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    letter-spacing: -0.02em;
    font-family: 'Noto Sans JP', sans-serif;
}
.login-incentive-overlay {
    position: relative;
    width: 100%;
    min-height: 400px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.login-incentive-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    animation: fadeInSlideUp 0.6s ease-out;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-incentive-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-incentive-subtitle {
    font-size: 16px;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.9);
}

.login-incentive-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
    text-align: left;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: transform 0.2s;
}

.benefit-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.1);
}

.benefit-icon {
    color: #ffd700;
    font-size: 18px;
}

.login-incentive-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-premium {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-premium:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    width: 400px;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    font-family: Arial, sans-serif;
  }
  
  .chat-window {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: #f0f0f0;
  }
  
  .message {
    max-width: 70%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 16px;
    word-wrap: break-word;
  }
  
  .user {
    background-color: #dcf8c6;
    margin-left: auto;
  }
  
  .bot {
    background-color: #fff;
    margin-right: auto;
  }
  
  .message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
  }
  
  .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
  }
  
  .timestamp {
    font-size: 12px;
    color: #888;
  }
  
  .read-status {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
  }
  
  .chat-input {
    display: flex;
    padding: 10px;
    background-color: #fff;
  }
  
  .input-field {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
  }
  
  .send-button {
    margin-left: 10px;
    padding: 8px 16px;
    background-color: #25d366;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
  }
/* DrawingRoom.css - Premium Glassmorphism Design */

:root {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --bg-dark: #0f172a;
    --panel-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.drawing-room-container {
    background: #0f172a !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    /* Basis for layout */
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    /* More opaque dark glass */
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: var(--panel-shadow);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

canvas {
    cursor: crosshair;
}

/* Fabric.js が生成するラッパー */
.canvas-container {
    width: 100%;
    height: 100%;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    overflow: hidden;
    background-color: transparent !important;
}

.canvas-container-root {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.drawing-room-container[data-tool="move"] .canvas-container canvas {
    cursor: grab !important;
}

.drawing-room-container[data-tool="move"] .canvas-container.grabbing canvas {
    cursor: grabbing !important;
}

.drawing-room-container[data-tool="select"] .canvas-container canvas {
    cursor: default !important;
}

/* Header Styles - Minimal Info Bar */
.room-header {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(15, 23, 42, 0.7);
    width: fit-content;
}

.room-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.room-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
}

/* SMS Verification Notice Banner */
.sms-verify-notice {
    position: fixed;
    top: 5rem;
    left: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 1rem;
    background: rgba(245, 158, 11, 0.15);
    /* Amber background */
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    font-size: 0.9rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    max-width: fit-content;
    margin: 0 auto;
}

.sms-verify-notice span {
    font-weight: 500;
}

.sms-verify-notice .verify-link {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 700;
    margin-left: 0.5rem;
}

.sms-verify-notice .verify-link:hover {
    color: #fbbf24;
}

@media (max-width: 1024px) {
    .sms-verify-notice {
        top: auto;
        bottom: 5.5rem;
        /* Above mobile drawer */
        left: 1rem;
        right: 1rem;
        max-width: none;
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }
}

.age-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    color: white;
    text-transform: uppercase;
}

.age-badge.age-2 {
    background: #eab308;
}

/* PG-12 */
.age-badge.age-3 {
    background: #f97316;
}

/* R-15 */
.age-badge.age-4 {
    background: #ef4444;
}

/* R-18 */
.age-badge.age-5 {
    background: #991b1b;
}

/* R-18G */

.online-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

/* Main Layout Adjustments - Full Screen Overlay Mode */
.main-layout {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    pointer-events: none;
    /* Let clicks pass to canvas by default */
    display: flex;
}

.canvas-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0f172a;
    background-image:
        linear-gradient(45deg, #1e293b 25%, transparent 25%),
        linear-gradient(-45deg, #1e293b 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e293b 75%),
        linear-gradient(-45deg, transparent 75%, #1e293b 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px 20px, 20px 0;
}

.sidebar-section {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 350px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    pointer-events: auto;
    /* Handle clicks */
}

/* Canvas Display in Full Screen */
.canvas-panel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.canvas-container-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s ease-out;
}

.custom-toolbar {
    position: absolute;
    top: 5.5rem;
    /* Below header */
    left: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 0.75rem;
    margin: 0;
    width: fit-content;
    pointer-events: auto;
}

.tool-control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.control-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.zoom-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 2.5rem;
    text-align: center;
}

.zoom-indicator-overlay {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.color-picker {
    width: 28px;
    height: 28px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
}

.size-slider {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
    transition: transform 0.1s;
}

.size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.line-width-preview-container {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 0.2rem;
}

.line-width-preview {
    border-radius: 50%;
    transition: width 0.1s, height 0.1s;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.line-width-preview-container {
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.line-width-preview-container:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.line-width-preview-container.active {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--accent-color);
}

.line-width-preview-container.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
}

.line-width-popover {
    position: absolute;
    left: calc(100% + 1rem);
    top: 50%;
    transform: translateY(-50%);
    padding: 1rem;
    width: 180px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8) translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(-50%) scale(1) translateX(0);
    }
}

.size-slider-large {
    width: 100%;
    margin: 1rem 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

.size-slider-large::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.popover-close-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s;
}

.popover-close-btn:hover {
    opacity: 0.9;
}

.line-width-presets-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}

.preset-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s, transform 0.1s;
    border: 1px solid transparent;
}

.preset-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.preset-item.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-color);
}

.preset-item:active {
    transform: scale(0.95);
}

.preset-circle {
    border-radius: 50%;
    /* Max size of preset icon should be visually reasonable */
    max-width: 24px;
    max-height: 24px;
}

.brush-type-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.brush-type-btn {
    flex: 1;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.brush-type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.brush-type-btn.active {
    background: rgba(99, 102, 241, 0.4);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    transform: scale(1.1);
}

.brush-type-btn span {
    font-size: 0.9rem;
    font-weight: 800;
}

.spray-icon-placeholder {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 4px 0 0 currentColor, -4px 0 0 currentColor, 0 4px 0 currentColor, 0 -4px 0 currentColor;
    opacity: 0.8;
}

.circle-icon-placeholder {
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.toolbar-divider {
    width: 20px;
    border-top: 1px solid var(--glass-border);
    margin: 0.25rem 0;
}

.tool-button {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.6rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.tool-button.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.tool-button.active:disabled {
    background: rgba(99, 102, 241, 0.2);
    box-shadow: none;
}

.tool-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
    pointer-events: auto !important;
    /* To show tooltip */
}

.finalize-button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.finalize-button:hover {
    background: var(--accent-hover);
}

.finalize-button:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    opacity: 0.5;
    cursor: not-allowed;
    border: 1px solid var(--glass-border);
}

.reset-button {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.6rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-button:hover {
    background: rgba(239, 68, 68, 0.3);
}

.reset-button:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-color: var(--glass-border);
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Chat Styles */
.chat-panel {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-message {
    margin-bottom: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-user {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.2rem;
}

.message-content {
    background: rgba(255, 255, 255, 0.07);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem 1rem 1rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-form {
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex-grow: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
    color: white;
    outline: none;
}

.chat-input:focus {
    border-color: var(--accent-color);
}

.chat-input:disabled {
    opacity: 0.6;
    background: rgba(15, 23, 42, 0.4);
    cursor: not-allowed;
    color: var(--text-secondary);
}

.chat-send-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}

/* Custom Dialog */
.custom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.custom-modal {
    width: 400px;
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.input-field {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 0.8rem;
    border-radius: 0.5rem;
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .drawing-room-container {
        padding: 1rem;
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .main-layout {
        flex-direction: column;
        margin-top: 0;
        flex-grow: 1;
        position: relative;
    }

    .sidebar-section {
        position: static;
        /* Let it flow in flex mobile layout if needed, or keep absolute */
        width: 100%;
        margin-top: 0;
        pointer-events: none;
        /* Container itself transparent */
    }

    .layer-panel-container {
        display: none;
        /* Hide layer panel in mobile by default or move to drawer */
    }

    /* Floating Header in Mobile */
    .room-header {
        position: fixed;
        top: 0.75rem;
        left: 0.75rem;
        right: auto;
        padding: 0.4rem 0.8rem;
        border-radius: 1rem;
    }

    .room-name {
        font-size: 0.85rem;
    }

    .room-badge {
        padding: 0.1rem 0.4rem;
        font-size: 0.75rem;
    }

    /* Floating Toolbar in Mobile */
    .custom-toolbar {
        position: fixed;
        top: 4.5rem;
        left: 0.75rem;
        z-index: 1001;
        background: rgba(15, 23, 42, 0.7);
        margin: 0;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    /* Canvas full center */
    .canvas-section {
        height: 100%;
        display: flex;
        flex-direction: row;
        /* Allow toolbar side-by-side in desktop, but view handles it */
        justify-content: center;
        align-items: center;
    }

    .canvas-panel-wrapper {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
    }

    /* Fixed Chat Box for Tablet/Mobile */
    .chat-panel {
        position: relative;
        /* Remove fixed to stay inside sidebar flow */
        bottom: auto;
        left: auto;
        right: auto;
        width: 100% !important;
        height: auto;
        flex-grow: 1;
        /* Take up remaining space */
        min-height: 300px;
        z-index: 10;
        border-radius: 1rem;
        transition: all 0.3s ease;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .chat-panel.collapsed {
        height: 50px;
        min-height: 50px;
        overflow: hidden;
    }

    .chat-header {
        cursor: pointer;
        padding: 0.5rem 0;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .chat-header::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
        margin: 0 auto 0.5rem;
    }
}

@media (max-width: 768px) {
    .drawing-room-container {
        padding: 0;
    }

    .glass-panel {
        padding: 1rem;
        border-radius: 1rem;
    }

    .custom-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
        top: 4.5rem;
    }

    .tool-button {
        padding: 0.4rem;
    }

    .finalize-button {
        width: 100%;
        margin-top: 0.25rem;
        padding: 0.5rem;
    }

    .custom-modal {
        width: 95%;
        padding: 1.5rem;
    }

    /* Canvas scale container */
    canvas {
        max-width: 100vw;
        max-height: 100vh;
        height: auto !important;
        width: auto !important;
        object-fit: contain;
    }
}

/* Layer Panel Styles */
.layer-panel {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.room-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
}

.age-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    color: white;
    text-transform: uppercase;
}

.age-badge.age-2 {
    background: #eab308;
}

/* PG-12 */
.age-badge.age-3 {
    background: #f97316;
}

/* R-15 */
.age-badge.age-4 {
    background: #ef4444;
}

/* R-18 */
.age-badge.age-5 {
    background: #991b1b;
}

/* R-18G */

.layer-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: var(--text-primary);
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.layer-item.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-color);
}

.layer-item.is-dragging {
    background: rgba(30, 41, 59, 0.9) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-color);
    z-index: 10001;
}

.layer-handle {
    display: flex;
    align-items: center;
    cursor: grab;
    padding-right: 0.25rem;
}

.layer-handle:active {
    cursor: grabbing;
}

.layer-preview-thumbnail {
    width: 48px;
    height: 32px;
    background-color: #f0f0f0;
    background-image:
        linear-gradient(45deg, #ddd 25%, transparent 25%),
        linear-gradient(-45deg, #ddd 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ddd 75%),
        linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.layer-preview-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.empty-preview {
    width: 100%;
    height: 100%;
    /* コンテナの背景が見えるので中身は空で良い */
}

.layer-info {
    flex-grow: 1;
    font-size: 0.85rem;
    font-weight: 500;
}


.layer-actions {
    display: flex;
    gap: 0.4rem;
}

.layer-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.layer-action-btn.active {
    color: var(--accent-color);
}

/* Context Menu Styles */
.custom-context-menu {
    position: fixed;
    z-index: 2000;
    min-width: 180px;
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    padding: 0.5rem;
    animation: contextMenuFadeIn 0.2s ease-out;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.context-menu-item {
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.context-menu-item.danger {
    color: #ef4444;
}

.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.4rem 0;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-spin {
    animation: spin 1s linear infinite;
}

.image-tools-popover {
    position: absolute;
    bottom: 0;
    left: 110%;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1001;
    min-width: 140px;
}

.image-option-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    text-align: left;
    width: 100%;
    white-space: nowrap;
}

.image-option-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.image-option-btn svg {
    font-size: 1.1rem;
}

/* Mobile Responsiveness */
.sidebar-toggle-btn,
.sidebar-mobile-tabs {
    display: none;
}

@media (max-width: 1024px) {
    .sidebar-section {
        padding-top: 1rem;
        /* Base padding */
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .sidebar-section.active {
        right: 0;
        pointer-events: auto !important;
    }

    .room-header {
        z-index: 3000 !important;
        /* Above sidebar */
    }

    .layer-panel-container {
        display: flex !important;
        height: auto;
        flex-grow: 1;
        min-height: 200px;
        overflow-y: auto;
        /* Scroll inside layer list */
    }

    .layer-panel {
        max-height: none;
        /* Let container handle scroll */
    }

    .sidebar-mobile-tabs {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
        padding: 0.5rem;
        background: rgba(30, 41, 59, 0.8);
        /* Darker, more opaque background */
        backdrop-filter: blur(10px);
        border-radius: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .sidebar-mobile-tabs .tab-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.2rem;
        padding: 0.5rem 0.2rem;
        border-radius: 0.75rem;
        border: 1px solid transparent;
        background: transparent;
        color: var(--text-secondary);
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .sidebar-mobile-tabs .tab-btn span {
        font-size: 0.7rem;
    }

    .sidebar-mobile-tabs .tab-btn.active {
        background: var(--accent-color);
        color: #fff;
        border-color: var(--accent-color);
    }

    .chat-panel.input-only .chat-messages {
        display: none;
    }

    .chat-panel.input-only {
        min-height: auto;
        flex-grow: 0;
    }

    .chat-toggle-btn {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: #fff;
        padding: 0.25rem;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .sidebar-toggle-btn {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: rgba(99, 102, 241, 0.2);
        border: 1px solid rgba(99, 102, 241, 0.3);
        padding: 0.4rem 0.8rem;
        border-radius: 2rem;
        color: #fff;
        cursor: pointer;
        z-index: 2001;
        transition: all 0.2s;
    }

    .sidebar-mobile-tabs {
        display: flex;
        /* Show tabs on all mobile/tablet sizes */
    }
}

.sidebar-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.3);
}

.sidebar-toggle-btn .btn-label {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Small Mobile Adjustments */
@media (max-width: 640px) {
    .room-header {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .custom-toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        height: auto;
        min-height: 120px;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.75rem;
        padding-bottom: env(safe-area-inset-bottom, 1rem);
        /* iPhone safe area */
        justify-content: center;
        gap: 0.5rem;
        border-radius: 1.5rem 1.5rem 0 0;
        overflow-x: hidden;
        z-index: 1100;
        background: rgba(15, 23, 42, 0.9);
        border-top: 1px solid var(--glass-border);
    }

    .tool-control-group {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        min-width: unset;
        gap: 0.5rem;
        padding: 0.2rem 0.5rem;
    }

    .integrated-toolbar .tool-button,
    .custom-toolbar .tool-button {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .tool-button svg {
        font-size: 1.5rem !important;
        /* Larger icons */
    }

    .toolbar-divider {
        display: none;
        /* Hide dividers to save space on mobile wrap */
    }

    .line-width-popover {
        left: 50%;
        top: 100%;
        bottom: auto;
        transform: translateX(-50%);
        animation: popInMobile 0.3s ease-out;
        z-index: 1002;
    }

    @keyframes popInMobile {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }

    .image-tools-popover {
        left: 50%;
        top: 100%;
        bottom: auto;
        transform: translateX(-50%);
        width: 180px;
        max-width: 90vw;
        z-index: 1002;
    }

    .sidebar-toggle-btn .btn-label {
        display: none;
    }

    .sidebar-section {
        width: 100%;
    }

    .zoom-value {
        font-size: 0.75rem;
        min-width: 2.5rem;
        text-align: center;
    }

    .color-picker {
        width: 38px;
        height: 38px;
    }

    .line-width-preview-container {
        width: 38px;
        height: 38px;
    }

    .line-width-popover,
    .image-tools-popover {
        border-radius: 1.5rem 1.5rem 0.5rem 0.5rem !important;
        padding-top: 2.5rem !important;
    }

    .popover-handle {
        display: block !important;
        position: absolute;
        top: 0.75rem;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 6px;
        background: rgba(255, 255, 255, 0.6);
        /* More visible */
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 3px;
        cursor: pointer;
        z-index: 100;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .popover-handle::after {
        content: '';
        position: absolute;
        top: -15px;
        left: -30px;
        right: -30px;
        bottom: -15px;
    }
}

/* Handles for all Mobile/Tablet devices up to 1024px */
@media (max-width: 1024px) {
    .popover-handle {
        display: block !important;
        position: absolute;
        top: 0.75rem;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 6px;
        background: rgba(255, 255, 255, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 3px;
        cursor: pointer;
        z-index: 1500 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
        touch-action: none;
        /* Prevent scroll interference */
    }

    .integrated-toolbar {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
        align-items: center;
        padding: 1rem 0.5rem;
        width: 100%;
        position: relative;
    }

    .sidebar-section .popover-handle {
        top: 0.75rem;
        left: 50% !important;
        transform: translateX(-50%);
        background: #ffffff !important;
        /* Solid/Opaque */
        opacity: 1 !important;
        width: 60px;
        height: 6px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    }

    .custom-toolbar {
        display: none !important;
    }

    .sidebar-section {
        position: fixed;
        top: 64px;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        transform: translateY(calc(100% - 44px));
        visibility: visible;
        pointer-events: auto;
        z-index: 2000;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
        padding-top: 3rem !important;
        background: rgba(15, 23, 42, 0.98);
        /* Almost solid background */
    }

    .sidebar-section.active {
        transform: translateY(0);
    }

    /* Hide internal handles and redundant section titles on mobile */
    .layer-handle,
    .chat-header,
    .integrated-toolbar .popover-handle {
        display: none !important;
    }
}
/* MusicUpload Component Styles */

.music-upload-container {
  min-height: calc(100vh - 200px);
}

.track-card {
  transition: all 0.3s ease;
}

.track-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.dragging {
  opacity: 0.5;
}

.audio-waveform {
  width: 100%;
  height: 60px;
  background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.upload-progress {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.album-cover-placeholder {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
}

.track-duration-badge {
  font-variant-numeric: tabular-nums;
  font-family: 'Roboto Mono', monospace;
}

/* アニメーション */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.uploading-indicator {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  .music-upload-container {
    padding: 16px;
  }

  .album-cover-preview {
    max-width: 100%;
  }

  .track-metadata-grid {
    grid-template-columns: 1fr;
  }
}

/* ドラッグ中のスタイル */
.dragging-over {
  background-color: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
}

/* トラックリストのホバーエフェクト */
.track-item:hover .track-actions {
  opacity: 1;
}

.track-actions {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* タグ入力のスタイル */
.tag-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  min-height: 42px;
}

.tag-chip {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* アルバムカードのグリッドレイアウト */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* ステッパーのカスタムスタイル */
.custom-stepper .MuiStepLabel-root {
  cursor: pointer;
}

.custom-stepper .MuiStepLabel-label.Mui-completed {
  font-weight: 500;
}

.custom-stepper .MuiStepLabel-label.Mui-active {
  font-weight: 600;
  color: #667eea;
}

/* ファイルアップロードエリア */
.file-upload-area {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.drag-active {
  border-color: #667eea;
  background-color: rgba(102, 126, 234, 0.05);
}

.file-upload-area.has-file {
  border-color: #4caf50;
  background-color: rgba(76, 175, 80, 0.05);
}

/* プログレスバーのカスタマイズ */
.upload-progress-bar {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
}

/* 音声プレーヤーのミニビュー */
.audio-player-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-top: 12px;
}

.audio-player-mini .play-button {
  min-width: 40px;
  height: 40px;
  border-radius: 50%;
}

.audio-player-mini .track-info {
  flex: 1;
  min-width: 0;
}

.audio-player-mini .track-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 確認画面のサマリーカード */
.summary-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.summary-card .album-info {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.summary-card .album-cover {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* トラックリストの番号表示 */
.track-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  font-weight: 600;
  margin-right: 12px;
}

/* エラーメッセージのスタイル */
.error-message {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* 成功メッセージ */
.success-message {
  animation: slideInUp 0.5s ease;
}

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

