* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Courier New', monospace, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  color: #fff;
}

#game-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

#dispatch-banner {
  background-color: #990000;
  color: #fff;
  padding: 10px 20px;
  font-weight: bold;
  font-size: 18px;
  white-space: nowrap;
  z-index: 20;
}

#cab-view {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#next-station-display {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  padding: 12px 24px;
  border: 2px solid #0f0;
  color: #0f0;
  font-size: 22px;
  font-weight: bold;
  z-index: 10;
  border-radius: 4px;
}

#dashboard {
  height: 220px;
  background-color: rgba(30, 30, 30, 0.95);
  border-top: 4px solid #555;
  padding: 15px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  z-index: 10;
}

#gauge-panel {
  display: flex;
  justify-content: space-around;
  width: 100%;
}

.gauge {
  background: #000;
  border: 2px solid #aaa;
  padding: 10px 40px;
  text-align: center;
  border-radius: 4px;
}

.gauge-label {
  font-size: 14px;
  color: #aaa;
}

.gauge-value {
  font-size: 36px;
  font-weight: bold;
  color: #0ff;
}

#notch-panel {
  display: flex;
  justify-content: center;
  gap: 60px;
}

.notch-box {
  font-size: 28px;
  font-weight: bold;
  background-color: #111;
  padding: 8px 30px;
  border: 2px solid #888;
  width: 180px;
  text-align: center;
  border-radius: 4px;
}

#controls {
  display: flex;
  justify-content: center;
  gap: 15px;
}

button {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  background: #555;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

button:hover {
  background: #777;
}

#eb-btn {
  background: #cc0000;
}
#eb-btn:hover {
  background: #ff0000;
}

/* モーダル表示用 */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-content {
  background: #222;
  border: 3px solid #ffcc00;
  padding: 30px;
  text-align: center;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
}

.type-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.type-btn {
  font-size: 20px;
  padding: 15px 30px;
}

.rank-large {
  font-size: 72px;
  font-weight: bold;
  color: #ffcc00;
  margin: 10px 0;
}

#result-details {
  text-align: left;
  margin: 15px 0;
  font-size: 16px;
  line-height: 1.6;
}

/* ロビーモーダル用スタイル追加 */
.tab-buttons {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  justify-content: center;
}

.tab-btn {
  background: #333;
  color: #ccc;
  border: 1px solid #555;
  padding: 8px 16px;
  font-size: 14px;
}

.tab-btn.active {
  background: #ffcc00;
  color: #000;
  font-weight: bold;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.area-btn {
  padding: 10px;
  font-size: 14px;
  background: #444;
}

.area-btn.active {
  background: #0055ff;
  border: 2px solid #00ffff;
}

.area-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.route-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 15px 0;
  max-height: 180px;
  overflow-y: auto;
}

.route-btn {
  background: #333;
  border: 1px solid #666;
  text-align: left;
  padding: 10px 15px;
  font-size: 14px;
}

.route-btn.active {
  background: #cc0000;
  border-color: #ffcc00;
}

#search-input {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  background: #111;
  color: #fff;
  border: 1px solid #ffcc00;
  border-radius: 4px;
  margin-bottom: 10px;
}

.primary-btn {
  background: #008000;
  font-size: 18px;
  width: 100%;
  margin-top: 10px;
}
.primary-btn:hover {
  background: #00b300;
}

/* 区間選択用スタイル */
.section-select-box {
  background: #111;
  padding: 12px;
  border: 1px solid #444;
  border-radius: 6px;
  margin: 15px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.station-dropdown {
  background: #222;
  color: #fff;
  border: 1px solid #ffcc00;
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
}

.station-dropdown:focus {
  outline: none;
  border-color: #00ffff;
}

/* 走行中矢印（>>>）のアニメーション演出 */
.arrow-flow span {
  display: inline-block;
  animation: arrowGlow 1.2s infinite;
  color: #555; /* 通常時は暗めの色 */
}
.arrow-flow span:nth-child(1) { animation-delay: 0s; }
.arrow-flow span:nth-child(2) { animation-delay: 0.4s; }
.arrow-flow span:nth-child(3) { animation-delay: 0.8s; }

@keyframes arrowGlow {
  0%   { color: #00ffff; text-shadow: 0 0 10px #00ffff; transform: scale(1.2); }
  50%  { color: #ffffff; text-shadow: 0 0 4px #ffffff; }
  100% { color: #555555; text-shadow: none; transform: scale(1); }
}

.version-tag {
    color: #fff; /* 文字を白に */
    text-shadow: 0 0 10px #00fff2, 0 0 20px #00fff2; /* ネオンのような光彩 */
    background-color: rgba(0, 0, 0, 0.5); /* 文字の裏を少し暗く */
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 15px;
    position: fixed; /* 画面に対して固定 */
    bottom: 15px;
    right: 10px;     /* 画面の右から10px */
    margin: 0;       /* 余計な余白を消す */
    z-index: 999999999999;
}

/* スマホ縦持ち専用スタイル（10% / 70% / 10% / 10% レイアウト） */
@media (max-width: 768px) and (orientation: portrait) {
  #game-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  /* 1. 線路情報・アナウンス表示 (10%) */
  #dispatch-banner {
    height: 10vh;
    font-size: 13px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    white-space: normal;
  }

  /* 2. 線路画面 (70%) */
  #cab-view {
    height: 50vh;
    flex: none;
  }

  #next-station-display {
    font-size: 14px;
    padding: 4px 10px;
    top: 5px;
    width: 95%;
    text-align: center;
  }

 /* 2. 進行画面 (50%) */
  #cab-view {
    height: 30vh;
    flex: none;
  }

  /* 下部エリア全般 (40% = 10% + 30%) */
  #dashboard {
    height: 40vh;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: rgba(20, 20, 20, 0.98);
  }

  /* 3. 速度・制限速度・位置情報エリア (10%) */
  #gauge-panel {
    height: 10vh;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
  }

  .gauge {
    padding: 4px;
    flex: 1;
    text-align: center;
  }

  .gauge-label {
    font-size: 9px;
  }

  .gauge-value {
    font-size: 16px;
  }

  /* 4. 制御パネルエリア (30%) */
  #notch-panel {
    display: flex;
    height: 30%; /* 30%領域の中の30% */
    gap: 6px;
    justify-content: center;
    align-items: center;
  }

  .notch-box {
    font-size: 14px;
    padding: 2px 4px;
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #111;
    border: 1px solid #888;
  }

  #controls {
    height: 65%; /* 30%領域の中の65% */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    align-items: center;
  }

  button {
    height: 100%;
    padding: 2px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  button {
    height: 80%;
    padding: 2px;
    font-size: 11px;
  }

  .area-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    padding: 15px;
  }

  .section-select-box {
    flex-direction: column;
    gap: 6px;
  }

 #version-tag {
    color: #fff; /* 文字を白に */
    text-shadow: 0 0 10px #00fff2, 0 0 20px #00fff2; /* ネオンのような光彩 */
    background-color: rgba(0, 0, 0, 0.5); /* 文字の裏を少し暗く */
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 15px;
    position: fixed; /* 画面に対して固定 */
    bottom: 15px;
    right: 20px;     /* 画面の右から10px */
    margin: 0;       /* 余計な余白を消す */
    z-index: 999999999999;
}
}