* {
  box-sizing: border-box;
}

html,
body {
  width: 600px;
  height: 600px;
  margin: 0;
  overflow: hidden;
  background: #0a0a0f;
  color: #f4f7fc;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
}

.screen {
  position: relative;
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #0a0a0f;
}

.hidden,
.row-hidden {
  display: none !important;
}

/* ===== 上部バー ===== */
.topbar {
  width: 600px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 2px solid #33506a;
  background: #14171d;
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.topbar-mark {
  flex: 0 0 auto;
  color: #8fe9ff;
  font-size: 28px;
}

.topbar-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 中央メッセージ（空・エラー・ローディング）===== */
.message {
  position: absolute;
  top: 68px;
  left: 0;
  z-index: 3;
  width: 600px;
  height: 532px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  background: #0a0a0f;
  color: #eef2f8;
  font-size: 24px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
}

/* ===== リスト領域 ===== */
.item-list {
  width: 600px;
  height: 496px;
  overflow: hidden;
  padding: 12px 12px 8px;
}

.pager {
  width: 600px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #2c3038;
  background: #14171d;
  color: #aab4c2;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ===== カード共通 ===== */
.chan-row,
.msg-row {
  width: 576px;
  margin: 0 0 12px;
  border: 2px solid #3b4552;
  border-radius: 10px;
  background: #171c25;
  color: #f4f7fc;
}

.chan-row {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
}

.msg-row {
  padding: 15px 18px 14px;
}

/* フォーカス（選択中）＝明るいシアン枠＋グロー */
.focusable:focus {
  outline: none;
  border-color: #8fe9ff;
  background: #223042;
  box-shadow: 0 0 0 3px rgba(143, 233, 255, 0.30);
}

/* ===== チャンネル行 ===== */
.chan-prefix {
  flex: 0 0 26px;
  color: #8fe9ff;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
}

.chan-info {
  min-width: 0;
}

.chan-name {
  color: #ffffff;
  font-size: 25px;
  line-height: 1.22;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chan-private {
  margin-top: 4px;
  color: #9aa4b2;
  font-size: 15px;
  font-weight: 700;
}

/* ===== メッセージ行 ===== */
.msg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.msg-author {
  min-width: 0;
  color: #8fe9ff;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-time {
  flex: 0 0 auto;
  color: #9aa4b2;
  font-size: 15px;
  font-weight: 700;
}

.msg-text {
  margin-top: 9px;
  color: #f4f7fc;
  font-size: 21px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

/* ===== メッセージ内メディアのchip ===== */
.msg-media {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.media-chip {
  padding: 6px 14px;
  border: 2px solid #3d6f86;
  border-radius: 999px;
  background: #14232c;
  color: #bfeeff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.media-chip.play {
  border-color: #8fe9ff;
  color: #8fe9ff;
}

.media-open {
  color: #8b96a4;
  font-size: 15px;
  font-weight: 700;
}

/* ===== メディアビューア（全画面）===== */
.screen-media {
  display: flex;
  flex-direction: column;
}

.media-counter {
  margin-left: auto;
  color: #aab4c2;
  font-size: 18px;
  font-weight: 700;
}

.media-stage {
  flex: 1 1 auto;
  width: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000000;
  padding: 8px;
}

.media-full {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-yt {
  width: 568px;
  height: 320px;
  max-width: 100%;
  border: 0;
}

.media-error {
  max-width: 520px;
  padding: 24px;
  color: #ffd2d2;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.media-hint {
  flex: 0 0 auto;
  width: 600px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-top: 1px solid #2c3038;
  background: #14171d;
  color: #aab4c2;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}
