/* カスタムスタイル */
body {
  font-family: 'Noto Sans JP', sans-serif;
}

/* Alpine.js x-cloak */
[x-cloak] {
  display: none !important;
}

/* モバイルメニューの初期状態を強制的に非表示 */
.md\\:hidden > div[class*="fixed"][class*="inset-0"],
.md\\:hidden > div[class*="fixed"][class*="top-0"][class*="right-0"] {
  display: none;
}

/* モーダルアニメーション */
.modal-button {
  transition: all 0.2s ease-in-out;
}

.modal-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-bg {
  position: relative;
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.85) 0%, rgba(55, 65, 81, 0.85) 100%);
  overflow: hidden;
  transition: background 0.3s ease;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/static/images/hero.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0;
  animation: fadeIn 0.8s ease-in forwards;
}

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

.room-card {
  transition:
    transform 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
}

.room-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.fixed-header {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

.game-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  background-image: none;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.mhp-icon {
  background-color: rgba(139, 69, 19, 0.8); /* MHP色 - 茶色系 */
  background-image: none;
  position: relative;
}
.mhp-icon::before {
  content: 'MHP';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.mhp2-icon {
  background-color: rgba(70, 130, 180, 0.8); /* MHP2色 - 青色系 */
  background-image: none;
  position: relative;
}
.mhp2-icon::before {
  content: 'MHP2';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 9px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.mhp2g-icon {
  background-color: rgba(34, 139, 34, 0.8); /* MHP2G色 - 緑色系 */
  background-image: none;
  position: relative;
}
.mhp2g-icon::before {
  content: 'MHP2G';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 8px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.mhp3-icon {
  background-color: rgba(218, 165, 32, 0.8); /* MHP3色 - 金色系 */
  background-image: none;
  position: relative;
}
.mhp3-icon::before {
  content: 'MHP3';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 9px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.mhxx-icon {
  background-color: rgba(0, 0, 0, 0.8); /* MHXX色 - 黒色系 */
  background-image: none;
  position: relative;
}
.mhxx-icon::before {
  content: 'MHXX';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 9px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 大文字版のゲームアイコンも対応 */
.MHP-icon, .Mhp-icon {
  background-color: rgba(139, 69, 19, 0.8); /* MHP色 - 茶色系 */
  background-image: none;
  position: relative;
}
.MHP-icon::before, .Mhp-icon::before {
  content: 'MHP';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.MHP2-icon, .Mhp2-icon {
  background-color: rgba(70, 130, 180, 0.8); /* MHP2色 - 青色系 */
  background-image: none;
  position: relative;
}
.MHP2-icon::before, .Mhp2-icon::before {
  content: 'MHP2';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 9px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.MHP2G-icon, .Mhp2g-icon {
  background-color: rgba(34, 139, 34, 0.8); /* MHP2G色 - 緑色系 */
  background-image: none;
  position: relative;
}
.MHP2G-icon::before, .Mhp2g-icon::before {
  content: 'MHP2G';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 8px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.MHP3-icon, .Mhp3-icon {
  background-color: rgba(218, 165, 32, 0.8); /* MHP3色 - 金色系 */
  background-image: none;
  position: relative;
}
.MHP3-icon::before, .Mhp3-icon::before {
  content: 'MHP3';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 9px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.MHXX-icon, .Mhxx-icon {
  background-color: rgba(0, 0, 0, 0.8); /* MHXX色 - 黒色系 */
  background-image: none;
  position: relative;
}
.MHXX-icon::before, .Mhxx-icon::before {
  content: 'MHXX';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 9px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* デフォルトのゲームアイコン（未定義の場合） */
.game-icon:not([class*="-icon"]):not(.mhp-icon):not(.mhp2-icon):not(.mhp2g-icon):not(.mhp3-icon):not(.mhxx-icon) {
  background-color: rgba(128, 128, 128, 0.8);
  position: relative;
}
.game-icon:not([class*="-icon"]):not(.mhp-icon):not(.mhp2-icon):not(.mhp2g-icon):not(.mhp3-icon):not(.mhxx-icon)::before {
  content: attr(data-game);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 8px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}


/* モバイルでデスクトップ認証ボタンを非表示 */
@media (max-width: 767px) {
  .auth-buttons-desktop {
    display: none !important;
  }
  
  /* 部屋詳細ページのSlackライクレイアウト */
  .mobile-chat-area {
    /* モバイルヘッダー(56px) + メッセージフォーム(160px) を引いた高さ */
    height: calc(100vh - 56px - 160px);
    min-height: 0;
    overflow-y: auto;
  }

  /* モバイル版のメインコンテナ高さ調整 */
  .mobile-room-detail {
    height: 100vh;
    overflow: hidden;
    flex-direction: column;
  }

  /* モバイル版のメッセージフォームを画面下部に固定 */
  .mobile-message-form {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
}

/* ちらつき防止用のスタイル */
.auth-controls-wrapper {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease-in-out, visibility 0.2s;
}

.auth-controls-wrapper.loaded {
  visibility: visible;
  opacity: 1;
}
