 *{box-sizing:border-box}
  html,body{height:0%;margin:0;font-family:system-ui,-apple-system,'Segoe UI',Roboto,'Hiragino Kaku Gothic ProN',Meiryo,sans-serif;background:#fff;color:#111}
  a{color:inherit;text-decoration:none}
  img{max-width:100%;display:block}
header {
  position: fixed;               /* ← sticky → fixed に変更（完全に固定） */
  top: 0;
  left: 0;
  right: 0;                      /* 左右いっぱいに広げる */
  z-index: 1000;                 /* サイドバーより上に来るように高く */
  background: #fff;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 12px;
  height: 64px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* 影を少し加えて浮いてる感を強調（任意） */
}

/* ヘッダーが固定になった分、bodyやメインに上余白を追加 */
body {
  padding-top: 64px;             /* ← headerの高さ分だけ下にずらす */
}

/* サイドバーのtopをheaderの下に調整（すでにtop:64px; ならOK） */
.sidebar-fixed {
  top: 64px;                     /* 変わらず */
}
  .logo{display:flex;align-items:center;gap:8px;cursor:pointer}
  .logo .icon{width:36px;height:36px;border-radius:6px;background:#ff0000;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700}
  .search{flex:1;display:flex;justify-content:center}
  .search input{width:100%;max-width:720px;padding:10px 14px;border-radius:20px;border:1px solid #ddd;outline:none}
  .actions{display:flex;gap:12px;align-items:center}
  main{display:flex;gap:20px;padding:16px;align-items:flex-start}
  .content{flex:1}
  .video-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px}
  .card{cursor:pointer}
.thumb{
  position:relative;
  border-radius:6px;
  overflow:hidden;
  background:#eee;
  aspect-ratio:16/9;
}

.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
  .meta{display:flex;gap:12px;margin-top:8px}
  .channel-thumb{width:36px;height:36px;border-radius:50%;flex:0 0 36px;background:#ddd;overflow:hidden}
  .meta .info{flex:1}
  .meta .info .title{font-weight:600;line-height:1.2;margin-bottom:6px}
  .meta .info .sub{color:#606060;font-size:13px}
  .watch-container{display:flex;gap:20px}
  .main-col{flex:0 0 60%}
  .side-col{flex:0 0 40%}
  .player-box{background:#000;aspect-ratio:16/9;border-radius:6px;overflow:hidden}
  .player-meta{margin-top:12px}
  .player-meta h1{font-size:18px;margin:0 0 8px 0}
  .stats{color:#606060;font-size:13px;margin-bottom:12px;display:flex;gap:12px;flex-wrap:wrap}
  .channel-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid #eee;border-bottom:1px solid #eee;margin-top:12px}
  .channel-row img{width:48px;height:48px;border-radius:50%;overflow:hidden}
  .channel-row .ch-info{flex:1}
  .btn-sub{background:#cc0000;color:#fff;padding:8px 12px;border-radius:16px;font-weight:700;cursor:pointer}
  .comments{margin-top:12px}
  .comment{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid #f0f0f0}
  .comment img{width:36px;height:36px;border-radius:50%}
  .comment .c-body{flex:1}
  .comment .c-body .name{font-weight:700;font-size:13px}
  .comment .c-body .text{color:#333;margin-top:6px}
  .related-item{display:flex;gap:12px;padding:8px 0;border-bottom:1px solid #f5f5f5;cursor:pointer}
.related-thumb{
  position:relative;
  width:168px;
  flex:0 0 168px;
  aspect-ratio:16/9;
  overflow:hidden;
  border-radius:6px;
}

.related-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.related-info{flex:1}
.related-info .title{font-size:14px;font-weight:600}

@media(max-width:900px){
  main{padding:12px}
  .watch-container{flex-direction:column}
  .main-col,.side-col{flex:1 1 100%}
  .related-thumb{
    width:120px;
    flex:0 0 120px;
    aspect-ratio:16/9;
  }
  .search input{max-width:420px}
}
  .watch-container { display: flex; gap: 20px; height: calc(100vh - 64px - 32px); overflow: hidden; }
  .main-col { flex: 0 0 60%; display: flex; flex-direction: column; overflow-y: auto; padding-right: 4px; min-height: 0; }
  .side-col { flex: 0 0 40%; display: flex; flex-direction: column; overflow-y: auto; padding-left: 4px; }
  .player-box { flex: 0 0 auto; }
  .comments { flex: 1 1 auto; overflow-y: auto; }
.btn-sub.disabled {
  opacity: 0.4;
  pointer-events: none;
}

 /* メニューアイコン（hamburger） */
.menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}
.menu-btn:hover {
  background: #f0f0f0;
}
.menu-btn svg {
  width: 24px;
  height: 24px;
  fill: #0f0f0f;
}

/* サイドメニュー */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px; /* 隠す */
  width: 280px;
  height: 100%;
  background: white;
  z-index: 1000;
  box-shadow: 2px 0 8px rgba(0,0,0,0.2);
  transition: left 0.3s ease;
  overflow-y: auto;
}
.sidebar.open {
  left: 0;
}

/* オーバーレイ（外を押すと閉じる） */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* メニューアイテム */
.menu-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  font-size: 14px;
  color: #0f0f0f;
  cursor: pointer;
}
.menu-item:hover {
  background: #f2f2f2;
}
.menu-item svg {
  width: 24px;
  height: 24px;
  fill: #606060;
}
.menu-item.active svg {
  fill: #065fd4; /* YouTubeの青 */
}



/* モバイル時はフル幅に戻す */
@media (max-width: 900px) {
  .sidebar-fixed {
    display: none;               /* 完全に非表示に（ハンバーガーだけ残す） */
  }
  main.content-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* メニューアイテム（アイコン + 下に文字） */
.sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  margin: 4px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
  font-size: 12px;
  color: #0f0f0f;
}

.sidebar-item:hover {
  background: #f2f2f2;
}

.sidebar-item.active {
  background: #fee2e2; /* 薄い赤（YouTube風） */
  color: #cc0000;
}

.sidebar-item svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  fill: #606060;
}

.sidebar-item.active svg {
  fill: #cc0000; /* YouTube赤 */
}

/* メインコンテンツを右にずらす（サイドバー分） */
main.content-main {
  margin-left: 240px; /* サイドバー幅 */
  transition: margin-left 0.3s;
}

@media (max-width: 900px) {
  main.content-main {
    margin-left: 0;
  }
}






/* ゲームカードもホームと同じスタイルを流用 */
#gameGrid .card .thumb img {
  aspect-ratio: 16/9;          /* 動画と同じ比率で統一 */
  object-fit: cover;
}

/* ツール/ゲームのプレイ画面をフル領域に */
.play-fullscreen {
  position: fixed;
  top: 64px;                     /* headerの高さ分 */
  left: 72px;                    /* 左サイドバーの幅分 */
  right: 0;
  bottom: 0;
  z-index: 20;                   /* headerより下だけどコンテンツの上 */
  background: #000;              /* 黒背景で没入感 */
  overflow: hidden;
}
body.sidebar-hidden .play-fullscreen {
  left: 0;
}

/* iframeを完全にフィット */
.play-fullscreen iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* モバイル対応（左バー非表示時） */
@media (max-width: 900px) {
  .play-fullscreen {
    left: 0;                     /* モバイルでは左端まで */
  }
}

 body.dark-mode {
  background: #0f0f0f;
  color: #e0e0e0;
}
body.dark-mode header {
  background: #1e1e1e;
  border-bottom: 1px solid #333;
}
body.dark-mode .sidebar,
body.dark-mode .sidebar-fixed {
  background: #1e1e1e;
}
body.dark-mode .menu-item:hover,
body.dark-mode .sidebar-item:hover {
  background: #333;
}
body.dark-mode .card {
  background: #1e1e1e;
}
body.dark-mode .video-grid,
body.dark-mode .watch-container {
  color: #e0e0e0;
}
/* 必要に応じて他の要素も追加 */

 .setting-group {
  margin-bottom: 32px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #eee;
}
.setting-group h2 {
  font-size: 18px;
  margin: 0 0 16px;
  color: #0f0f0f;
}
.setting-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  cursor: pointer;
}
.setting-label input {
  width: 18px;
  height: 18px;
}
.danger-btn {
  padding: 10px 20px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 12px;
}
.danger-btn:hover {
  background: #c82333;
}
 
/* 通知ポップアップ */
.notification-popup {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 320px;
  max-height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 10000;
  overflow-y: auto;
  font-size: 14px;
}
.notification-popup .header {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
}
.notification-popup .item {
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.notification-popup .item:hover {
  background: #f5f5f5;
}
.notification-popup .item .title {
  font-weight: 600;
}
.notification-popup .item .date {
  font-size: 11px;
  color: #666;
}
/* メンテナンスオーバーレイ */
.maintenance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-direction: column;
}

/* 自動ポップアップ */
.notification-popup.auto {
  position: fixed;
  bottom: 20px;
  right: 20px;
  top: auto;
  left: auto;
  width: 360px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 20000;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #065fd4;
  color: white;
  border-radius: 16px 16px 0 0;
  font-weight: bold;
}
.close-popup {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.popup-body {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 0;
}
.popup-item {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}
.popup-title {
  font-weight: bold;
  margin-bottom: 4px;
}
.popup-content {
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
}
.popup-detail {
  background: none;
  border: 1px solid #065fd4;
  color: #065fd4;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
}
.popup-more {
  text-align: center;
  padding: 8px;
  color: #666;
  font-size: 12px;
}
.popup-footer {
  padding: 12px;
  text-align: center;
  border-top: 1px solid #eee;
}
.popup-footer button {
  background: #065fd4;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 24px;
  cursor: pointer;
}

/* 操作不可能メンテナンス：全画面白背景 */
.maintenance-overlay-full {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.maintenance-overlay-full .maintenance-card {
  background: #f8f9fa;
  border-radius: 24px;
  padding: 40px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.maintenance-overlay-full h2 {
  color: #c00;
  margin-bottom: 20px;
}

/* 操作可能メンテナンス：白いカードポップアップ */
.maintenance-card-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 360px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 20000;
  animation: slideIn 0.3s ease;
  border-left: 4px solid #ffc107;
}
.maintenance-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #ffc107;
  color: #333;
  border-radius: 16px 16px 0 0;
  font-weight: bold;
}
.maintenance-card-body {
  padding: 16px;
}
.maintenance-time {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

.notification-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 40000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80%;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
}
.modal-body {
  padding: 16px;
  line-height: 1.5;
}
.modal-footer {
  padding: 16px;
  text-align: right;
  border-top: 1px solid #eee;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

/* 詳細モーダル 強化版 */
.notification-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 40000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: white;
  border-radius: 24px;
  max-width: 560px;
  width: 90%;
  max-height: 85%;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 2px solid #f0f0f0;
}
.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1e3c72;
}
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  transition: 0.2s;
}
.modal-close:hover {
  color: #c00;
}
.modal-body {
  padding: 24px;
}
.detail-meta {
  display: flex;
  gap: 24px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  color: #666;
}
.detail-section {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}
.detail-section h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #ff9800;
}
.detail-section p {
  margin: 6px 0;
  font-size: 14px;
}
.detail-content h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
}
.content-text {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fafafa;
  padding: 16px;
  border-radius: 16px;
  font-size: 14px;
}
.modal-footer {
  padding: 16px 24px;
  text-align: right;
  border-top: 1px solid #eee;
}
.modal-close-btn {
  background: #065fd4;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 40px;
  cursor: pointer;
  font-size: 14px;
}
.modal-close-btn:hover {
  background: #0b4fa3;
}

/* 固定サイドバーの基本設定（左に隠れている状態） */
.sidebar-fixed {
  position: fixed;
  top: 56px;        /* ヘッダーの高さに合わせる */
  left: 0;
  bottom: 0;
  width: 240px;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 16px 0;
}

/* 表示状態（ボタンでON） */
.sidebar-fixed.visible {
  transform: translateX(0);
}

/* ダークモード対応 */
body.dark-mode .sidebar-fixed {
  background: #1e1e1e;
  color: #eee;
}

.content-main {
  transition: margin-left 0.3s ease;
}
.sidebar-fixed.visible ~ .content-main {
  margin-left: 240px; /* サイドバーの幅分ずらす */
}


/* 固定サイドバー（72px → ホバーで240px） */
.sidebar-fixed {
  position: fixed;
  top: 64px;                 /* ヘッダー高さにピッタリ合わせる */
  left: 0;
  bottom: 0;                 /* 下端まで */
  width: 72px;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.05);
  z-index: 1000;
  transform: translateX(0);
  transition: transform 0.3s ease, width 0.3s ease;  /* スライド＋ホバー拡大 */
  overflow-y: auto;
}

/* 非表示時 */
.sidebar-fixed.hidden {
  transform: translateX(-100%);
}

/* ホバーでぬるっと240pxに */
.sidebar-fixed:hover {
  width: 240px;
}

/* メインコンテンツ */
.content-main {
  margin-left: 72px;
  transition: margin-left 0.3s ease;
}

/* サイドバー非表示のときメインコンテンツのマージン0 */
.sidebar-fixed.hidden ~ .content-main {
  margin-left: 0;
}

/* ダークモード */
body.dark-mode .sidebar-fixed {
  background: #1e1e1e;
  color: #eee;
}

/* =============================================
   スケルトン（灰色のプレースホルダー）
   ============================================= */
.skeleton {
  background: #e0e0e0;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

/* シマー（光の流れ） */
.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* パーツ別のスケルトンサイズ（必要に応じて調整） */
.skeleton-thumb {
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-text {
  height: 16px;
  width: 90%;
  margin-bottom: 8px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ── スケルトン（灰色のプレースホルダー） ── */
.skeleton {
  background: #e0e0e0;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

/* 斜めに光が流れるシマーアニメーション */
.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 各パーツのサイズ指定 */
.skeleton-thumb {
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-text {
  height: 16px;
  width: 90%;
  margin-bottom: 8px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ダークモード用（必要なら） */
body.dark-mode .skeleton {
  background: #3a3a3a;
}
body.dark-mode .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
}
