/* 実況ビューア (/live) */
:root{
  --blue: #4A90E2;   --blue-bg: #EAF2FC;
  --yellow: #E0B000; --yellow-bg: #FDF6DA;
  --green: #4CAF6E;  --green-bg: #E8F5EC;
  --purple: #9B6BCF; --purple-bg: #F2ECF9;
  --none: #B8B8B8;   --none-bg: #F6F6F6;
}
*{ box-sizing: border-box; }
html, body{
  margin: 0;
  height: 100%;
  background: #FFFFFF;
  color: #222222;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
}
.live{
  display: flex;
}
.live-feed-pane{
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}
.live-viewer-pane{
  display: none;
}
/* PCでは左右2ペイン */
@media (min-width: 992px) and (hover: hover) and (pointer: fine){
  .live{
    height: 100vh;
  }
  .live-feed{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
  .live-feed-pane{
    width: 42%;
    max-width: 640px;
    border-right: 1px solid #DDDDDD;
  }
  .live-viewer-pane{
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
  }
}

.live-bar, .live-viewer-bar{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid #DDDDDD;
  background: #FAFAFA;
  min-height: 44px;
}
.live-warn{
  color: #D32F2F;
  font-size: 0.8rem;
  font-weight: bold;
}
.live-home{
  color: #555555;
  text-decoration: none;
}
.live-status{
  margin-left: auto;
  font-size: 0.8rem;
  color: #777777;
}
.live-feed-pane > .live-bar{
  position: sticky;
  top: 0;
  z-index: 1;
}
.live-legend{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid #EEEEEE;
  font-size: 0.8rem;
}
.live-legend > span:not(.live-note){
  padding: 1px 10px;
  border-radius: 999px;
  border-left: 0;
  color: #FFFFFF;
  background: var(--c);
  font-weight: bold;
}
.live-legend .live-yellow{ color: #3A2F00; }
.live-note{
  margin-left: auto;
  color: #777777;
}

.live-feed{
  padding: 8px;
}
.live-item{
  --c: var(--none);
  --bg: var(--none-bg);
  margin-bottom: 6px;
  padding: 6px 10px;
  border-left: 6px solid var(--c);
  border-radius: 4px;
  background: var(--bg);
}
.live-blue{ --c: var(--blue); --bg: var(--blue-bg); }
.live-yellow{ --c: var(--yellow); --bg: var(--yellow-bg); }
.live-green{ --c: var(--green); --bg: var(--green-bg); }
.live-purple{ --c: var(--purple); --bg: var(--purple-bg); }

.live-item header{
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.85rem;
}
.live-name{
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-leader{
  flex-shrink: 0;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--c);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: bold;
}
.live-item time{
  margin-left: auto;
  flex-shrink: 0;
  color: #888888;
  font-size: 0.75rem;
}
.live-reply{
  color: #888888;
  font-size: 0.8rem;
}
.live-body{
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  line-height: 1.5;
}
.live-post{
  display: block;
  margin-top: 4px;
  padding: 4px 8px;
  border: 1px solid var(--c);
  border-radius: 4px;
  background: #FFFFFF;
  font-weight: bold;
  text-decoration: none;
  color: #1A5FB4;
}
.live-post:hover{
  text-decoration: underline;
}
.live-has-post{
  border-left-width: 10px;
}
/* 新着は少しの間だけ目立たせる */
.live-new{
  animation: live-new 4s ease-out;
}
@keyframes live-new{
  0%, 40%{ box-shadow: 0 0 0 2px #FF9F1C; }
  100%{ box-shadow: 0 0 0 2px transparent; }
}
.live-playing{
  box-shadow: 0 0 0 2px #1A5FB4;
}
.live-empty{
  color: #777777;
  padding: 12px;
}

.live-viewer-title{
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: bold;
}
.live-viewer-link[hidden]{
  display: none;
}
.live-viewer-body{
  flex: 1;
  display: flex;
}
.live-viewer-body iframe{
  flex: 1;
  width: 100%;
  border: 0;
}
@media (prefers-reduced-motion: reduce){
  .live-new{ animation: none; box-shadow: 0 0 0 2px #FF9F1C; }
}
