/* ① scope内をリセット（既存CSSを極力無効化） */
.blackbody,
.blackbody *{
  all: revert;          /* 既存CSSを“元に戻す” */
  box-sizing: border-box;
}

/* ② 必要な基本だけ入れ直す（フォント等） */
.blackbody{
  padding: 10px 0;
  background: #222;
  font-family: "MS Gothic", "MS PGothic", "Osaka-Mono", "Courier New";
}

/* ③ ここから掲示板専用CSSを普通に書く */
.blackbody h2 {
  text-align: center;
  color: #ffa800;
}
.blackbody h3,
.blackbody p {
  color: #ffa800;
}
.blackbody figure {
  margin: 0 auto;
  width: fit-content;
}
.blackbody img {
  display: block;
  width: 760px;
  height: auto;
}
.board {
  width: 760px;
  margin: 0 auto;
  padding: 15px;
  background: #111;
  color: #ffa800; /* オレンジ色のLED風 */
  border: 10px solid #333; /* 枠を太くして筐体っぽく */
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.board .line-circle {
  color: #6fd36f;
}
.board-title {
  text-align: center;
  color: #ccc;
  margin-bottom: 5px;
  font-size: 24px;
}
.board-caution {
  width: 760px;
  text-align: left;
  margin: 0 auto;
}
.board-caution a {
  color: #BBDEFB;
}
.board-caution a:hover {
  color: #E3F2FD;
}
.board-caution h3,
.board-caution p {
  color: #ccc;
  padding: 0 10px;
}
.row {
  display: grid;
  grid-template-rows: 30px;
  grid-template-columns: 60px 60px 1fr 60px 60px;
  gap: 4px;
  padding: 4px 0;
  border-bottom: 1px solid #333;
  font-size: 18px;
  /* 文字にうっすら光彩（グロー効果）をつける */
  /* text-shadow: 0 0 5px rgba(255, 153, 0, 0.7); */
}
.row > div:nth-child(1) { /* のりば */
  justify-self: center;
  align-self: center;
}
.row > div:nth-child(2) { /* 系統 */
  justify-self: center;
  align-self: center;
}
.row > div:nth-child(3) { /* 行き先 */
  justify-self: start;
  align-self: center;
}
.row .time { /* 時刻 */
  justify-self: start;
  align-self: center;
  font-family: monospace;
}
.row .remain { /* あと◯分 */
  justify-self: end;
  align-self: center;
  font-family: monospace;
}
.header {
  color: #6fd36f;
  border-bottom: 3px solid #666;
  /* border-bottom: 2px solid #d3d3d3; */
  margin-bottom: 4px;
}
.time, .remain {
  font-weight: bold;
}
.line-circle {
  border-radius: 50%;
  border: 2px solid #6fd36f;
  text-align: center;
  font-size: 18px;
  width: 24px;
  height: 24px;
  line-height: 24px;
}
/* 5分以内の強調（赤色と点滅） */
.row.emer {
  color: #ff3333;
  font-weight: bold;
  animation: blink 1.5s infinite;
  /* 緊急時は赤い光彩 */
  text-shadow: 0 0 8px rgba(255, 51, 51, 0.9);
}
.route-title {
  text-align: center;
  margin: 10px;
  font-size: 24px;
}
/* 縦書きの修正 */
.route {
  display: block;           /* 重要：インライン要素だと効かない場合がある */
  text-align: center;
  text-align-last: justify;
  font-size: 18px;
  margin: 10px auto;        /* 左右中央寄せ */
  
  /* 縦書き設定 */
  -webkit-writing-mode: vertical-rl; /* Safari / iOS用 */
  writing-mode: vertical-rl;
  
  -webkit-text-orientation: upright; /* Safari / iOS用 */
  text-orientation: upright;
  
  line-height: 1.8;
  height: auto;             /* 高さを自動に */
  min-height: 200px;        /* 念のため高さを確保 */
}
.arrow {
  padding: 35% 0;
  /* color: #ffa800; オレンジ色のLED風 */
}
.highlight {
  background-color: #ffa800;
  color: #000;
  display: inline-block; /* ← これが重要 */
  padding: 0 10px;       /* 左右に余白 */
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* データがない時の空行 */
.row.empty {
  color: #F36C21; /* イエローレッド */
}

@media (max-width: 920px) {
  .blackbody img {
    display: block;
    width: 100%;
    height: auto;
  }
  .board {
    width: 100%;
    margin: 0 auto;
    padding: 10px 0;
    border: 2px solid #333;
    border-radius: unset;
    box-shadow: unset;
  }
  .row {
    grid-template-columns: 50px 40px 1fr 50px;
    font-size: 16px;
  }
  .row > div:nth-child(3) {
    word-break: break-all; /* 枠の端で強制的に改行する */
    line-height: 1.2;      /* 行間を少し詰めて高さを抑える */
  }
  .remain {
    display: none; /* あと◯分を非表示 */
  }
  .header {
    font-size: 16px;
    border-bottom: 3px solid #666;
    /* border-bottom: 2px solid #d3d3d3; */
    margin-bottom: 4px;
  }
  .board-title {
    margin-bottom: 2px;
    font-size: 22px;
  }
  .board-caution {
    max-width: 100%;
  }
  .board-caution h3 {
    font-size: 18px;
  }
  .route {
    line-height: 1.2; /* 駅間の余白調整 */
  }
}