body {
    background-color: rgb(255, 90, 208);
}

.video-container {
    position: relative;
    width: 90%;
    max-width: 640px;
    aspect-ratio: 16 / 9; /* 高さ統一はこれ！ */
    margin: 0 auto;
    background-color: #000;
    overflow: hidden;
    border-radius: 8px;
}

#myVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#playButton {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4em;
    height: 4em;
    transform: translate(-50%, -50%);
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.3s;
    pointer-events: auto;
    z-index: 10;
}

#playButton.hidden {
    opacity: 0;
    pointer-events: none;
}

#seekBar {
    position: absolute;
    bottom: 1vh;
    left: 0;
    width: 100%;
    z-index: 5;
    transition: opacity 0.3s;
}

#seekBar.hidden {
    opacity: 0;
    pointer-events: none;
}

#timeDisplay {
    position: absolute;
    bottom: 5vh;
    right: 1vw;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 0.3em 0.6em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: monospace;
    z-index: 6;
}

#timeDisplay.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#fullscreenButton {
    position: absolute;
    bottom: 1vh;
    right: 1vw;
    padding: 0.5em 1em;
    background-color: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    z-index: 7;
}

/* タイトル */
h2 {
    font-size: 2em;
    margin-top: 1em;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    text-align: center;
}

/* 説明文 */
p {
    font-size: 1em;
    color: #f0f0f0;
    background-color: rgba(0,0,0,0.4);
    padding: 1em;
    border-radius: 6px;
    line-height: 1.6;
    max-width: 90%;
    margin: 0.5em auto;
    text-align: left;
}

/* セクション */
.s {
    text-align: center;
    padding: 1.5em;
    background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(255,90,208,0.6));
    border-radius: 8px;
    max-width: 90%;
    margin: 1em auto;
}


/* 全画面ボタン位置調整 */
#fullscreenButton {
  position: absolute;
  bottom: 60px; /* timeDisplayの上あたり */
  right: 10px;
  padding: 4px 8px;
  background-color: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  z-index: 7;
  transition: opacity 0.3s;
}

#fullscreenButton.hidden {
  opacity: 0;
  pointer-events: none;
}

/* 動画情報セクション */
.video-info {
  margin: 1em 0;
}

.video-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5em;
  padding: 0.5em;
  background-color: rgba(0,0,0,0.3);
  border-radius: 4px;
  font-size: 0.9em;
}

.view-count {
  color: #fff;
  font-weight: bold;
}

.category {
  color: #ff5ad0;
  background-color: rgba(255,255,255,0.2);
  padding: 0.2em 0.5em;
  border-radius: 12px;
  font-size: 0.8em;
}

/* 関連動画セクション */
.related-videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 1em;
}

.related-video-item {
  background-color: rgba(0,0,0,0.4);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.related-video-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,90,208,0.3);
}

.related-video-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-video-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.related-video-info {
  padding: 10px;
}

.related-video-info h4 {
  margin: 0 0 5px 0;
  font-size: 1em;
  color: #fff;
  line-height: 1.3;
}

.related-video-info p {
  margin: 5px 0;
  font-size: 0.8em;
  color: #ccc;
  background: none;
  padding: 0;
}

.related-stats {
  font-size: 0.75em;
  color: #aaa;
  display: block;
  margin-top: 5px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .video-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3em;
  }
  
  .related-videos {
    grid-template-columns: 1fr;
  }
}