* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(180deg, #0f172a, #020617);
  color: #e5e7eb;
}

.container {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 2px solid rgba(255, 0, 255, 0.1);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

h1 {
  margin: 0;
  font-size: 2.2rem;
}
.section-title {
  position: relative;
  display: flex;
  align-items: center;
}
@media (max-width: 768px) {
  .section-title {
    margin: 10px auto auto auto;
  }

}

.title-icon {
  width: 128px;
  height: 128px;
  margin-left: 20px;
  border-radius: 50%;
  image-rendering: pixelated;
}
@media (max-width: 768px) {
  .title-icon {
    width: 64px;
    height: 64px;
    margin: auto auto auto 0;
    border-radius: 50%;
    image-rendering: pixelated;
  }

}

.title-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;

  width: 100%;
  max-width: 100%;
}


.subtitle {
  opacity: 0.8;
  margin-top: 8px;
}

h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

ul {
  padding-left: 18px;
}

code {
  display: block;
  background: #020617;
  padding: 12px;
  border-radius: 8px;
  word-break: break-all;
  margin-top: 8px;
  font-size: 0.9rem;
}

.label {
  margin-top: 16px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.links {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.links a {
  text-decoration: none;
  color: #38bdf8;
  font-weight: bold;
}

.links a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.5;
  margin-top: 24px;
}

/* 配信風ボックス全体 */
.stream-box {
  padding: 16px;
}
@media (max-width: 768px) {
  .stream-box {
    padding: 16px;
  }
  .stream-layout {
    flex-direction: column;
  }
  .stream-video {
    
  }

}


.stream-layout {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* 配信画面 */
.stream-video {
  flex: 2;
  position: relative;
  background: #000;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.stream-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.03),
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}


.stream-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
}

.live {
  color: white;
  background: #dc2626;
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0.4;
  }
}

.demolive{
  position: relative;
  width: 100%;
  height: 400px;
  background: black;
  overflow: hidden;
}

/* demolive コメント全体 */
#streamComments{
  position:absolute;
  bottom:25%;
  left:18%;
  width:50%;

  display:flex;
  flex-direction:column;

  z-index: 5;
}
@media (max-width: 768px) {
  
#streamComments{
  position:absolute;
  top: 25%;
  bottom: 25%;
  left:18%;
  width:50%;

  flex-direction:column;

  z-index: 5;
}
  #last-user{
    display:none;
  }
}


/* コメント本体 */
#streamComments p{
  position:relative;
  background:#ffffff;
  color:#555;
  padding:1px 14px;
  border-radius:30px;
  font-family:"Kosugi Maru","M PLUS Rounded 1c",sans-serif;
  font-size:11px;
  max-width:100%;
  line-height:1.4;
  margin: 7px;

  /* 雲っぽい柔らかい影 */
  box-shadow:
    0 3px 8px rgba(0,0,0,0.5),
    0 0 6px rgba(255,255,255,0.8);
}
#streamComments p::after{
  content:"";

  position:absolute;

  left:-6px;
  bottom:10px;

  width:12px;
  height:12px;

  background:white;

  border-radius:50%;

  box-shadow:
    -6px 4px 0 white;
}


.stream-character {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.stream-character img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: brightness(0.95) contrast(1.05);

}



/* チャット欄 */
.stream-chat {
  flex: 1;
  background: #020617;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 360px; /* ★ここ重要：固定高さ */
}
@media (max-width: 768px) {
  .stream-chat {
   height: auto;
   min-height: 200px;
   flex: none;
   background: #020617;
   border-radius: 12px;
   display: flex;
   flex-direction: column;
  }
  .chat-messages {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  height: auto;
  flex: 1;
  overflow-y: auto;
  font-size: 0.8rem;
  }
}

.chat-header {
  padding: 10px;
  font-weight: bold;
  border-bottom: 1px solid #1e293b;
  font-size: 0.85rem;
}

.chat-messages {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
  font-size: 0.8rem;
}

.chat-messages p {
  margin: 6px 0;
}


/* 中程度の豪華さ */
.chat-blue {
  --main-color: #002aff;
  --sub-color: #aaaaff;
  --border-size: 2px;
}

/* ネオン枠 */
.chat-tier {
  width: 100%;
  display: inline-block;
  position: relative;
  position: relative;
  padding: 12px;
  margin: 12px 0;
  border-radius: 14px;
  color: white;
  font-weight: bold;
}


.chat-red {
  --main-color: #ff2a6d;
  --sub-color: #8a2be2;
  --border-size: 3px;

  --run-animation: runLine 2.5s linear infinite;

}

.chat-ultimate {
  overflow: hidden; /* 光はみ出し防止 */
  --main-color: #00ffff;
  --sub-color: #ff00ff;
  --border-size: 4px;

  animation: hueShift 1s linear infinite;
}


.chat-tier::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: var(--border-size, 4px);

  background:
    linear-gradient(
      90deg,
      transparent 0%,
      transparent 40%,
      rgba(255,255,255,0.3) 48%,
      var(--main-color) 50%,
      rgba(255,255,255,0.3) 52%,
      transparent 60%,
      transparent 100%
    ),
    linear-gradient(
      90deg,
      var(--main-color),
      var(--sub-color)
    );

  background-size: 200% 100%, 100% 100%;
  background-repeat: no-repeat;

  animation: var(--run-animation, none);

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;

  filter:
    drop-shadow(0 0 8px var(--main-color))
    drop-shadow(0 0 18px var(--main-color));
}

.chat-tier.chat-ultimate::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;

  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 40%,
    rgba(255,255,255,0.2) 45%,
    rgba(255,255,255,0.9) 50%,
    rgba(255,255,255,0.2) 55%,
    transparent 60%,
    transparent 100%
  );

  background-size: 200% 100%;
  background-repeat: no-repeat;

  animation: runUltimate 4s linear infinite;
}
.chat-tier.chat-ultimate > * {
  position: relative;
  z-index: 1;
}

@keyframes runUltimate {
  0%   { background-position: 120% 0; }
  20%  { background-position: -20% 0; }
  100% { background-position: -20% 0; }
}

@keyframes hueShift {
  from { filter: hue-rotate(0deg); }
  to   { filter: hue-rotate(360deg); }
}


@keyframes runLine {
  from {
    background-position: 200% 0, 0 0;
  }
  to {
    background-position: -200% 0, 0 0;
  }
}

.user {
  margin-right: 4px;
  color : #38bdf8;
}

.chat-tier .user {
  background: linear-gradient(
    90deg,
    var(--main-color),
    var(--sub-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}



.chat-footer {
  padding: 8px;
  border-top: 1px solid #1e293b;
  font-size: 0.75rem;
  opacity: 0.7;
  text-align: center;
}
.chat-help-link {
  color: #38bdf8; /* 青文字 */
  text-decoration: underline; /* 下線 */
  cursor: pointer; /* マウスオーバーで手の形 */
  font-weight: 500;
  font-size: 1rem;
}

/* モーダル本体（画面全体） */
.chat-modal {
  display: none; /* ←最初は非表示 */
  position: fixed;
  z-index: 999999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}
@media (max-width: 768px){
  .chat-modal-content {
  position: relative; /* closeボタン用 */
  background-color: rgba(0,0,0,0.8);
  padding: 20px 30px;
  border-radius: 12px;
  color: #f1f5f9;
  width: 90%;
  height: 80%;
  max-width: 600px;
  overflow: hidden; 
  overflow-y: auto;
  /*text-align: center;*/
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  }
}


/* モーダル内コンテンツ */
.chat-modal-content {
  position: relative; /* closeボタン用 */
  background-color: rgba(0,0,0,0.8);
  padding: 20px 30px;
  border-radius: 12px;
  color: #f1f5f9;
  max-width: 600px;
  /*text-align: center;*/
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.chat-modal-content h2{
  text-align: center;
}
.chat-modal-content button{
  margin: 10px auto;
}
p.center{
  text-align: center;
  margin: 0 auto;
}

/* 閉じるボタン */
.chat-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #f1f5f9;
  transition: color 0.2s;
}
.chat-modal-close:hover {
  color: #f87171;
}
#chat-form{
  display:none;
  flex-direction:column;
  gap:10px;
  margin-top:20px;
}

#chat-name,
#chat-message,
#chat-amount{
  width:100%;
  padding:10px;
  border-radius:8px;
  border:1px solid #ccc;
  font-size:14px;
}
/*↓chat-messeageになってた。js大丈夫かな*/
#chat-message{
  resize:vertical;
  min-height:80px;
}

#send-chat{
  padding:10px;
  border:none;
  border-radius:8px;
  cursor:pointer;
}

















