/* ============================================
   タワーディフェンス２ - 固有スタイル
   ============================================ */

.game-lead {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 1rem;
}

.game-update {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(90deg, rgba(241, 196, 15, 0.15), rgba(241, 196, 15, 0.04));
  border-left: 3px solid #F1C40F;
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.game-update-label {
  font-weight: 700;
  color: #b8860b;
  white-space: nowrap;
}

.game-update-date {
  color: #999;
  font-size: 0.78rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.game-update-text {
  color: #555;
}

.score-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.score-box {
  background: #1a1a2e;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-align: center;
  min-width: 70px;
}

.score-label {
  display: block;
  font-size: 0.7rem;
  color: #f1c40f;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.btn-new-game {
  margin-left: auto;
  background: linear-gradient(180deg, #c0392b 0%, #8e2618 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s;
}

.btn-new-game:hover {
  filter: brightness(1.15);
}

/* HUD */
.game-hud {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.hud-item {
  background: linear-gradient(180deg, #243447 0%, #15202b 100%);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  text-align: center;
  flex: 1;
  border: 1px solid rgba(255,255,255,0.05);
}

.hud-label {
  display: block;
  font-size: 0.58rem;
  color: #8fb3d9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hud-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

/* タワー選択 */
.tower-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.tower-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 calc(25% - 0.35rem);
  min-width: 0;
  background: #2c3e50;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: #ddd;
}

.tower-btn:hover {
  background: #34495e;
}

.tower-btn.selected {
  border-color: #F1C40F;
  background: #34495e;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.4);
}

.tower-btn-sell.selected {
  border-color: #E74C3C;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

.tower-icon {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3);
}

.tower-info {
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.tower-info small {
  font-weight: 400;
  color: #F1C40F;
}

.tower-btn-sell .tower-info small {
  color: #E74C3C;
}

/* 速度コントロール＋メテオの行 */
.action-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: stretch;
}

.speed-control {
  display: flex;
  gap: 0.3rem;
  flex: 1;
}

.speed-btn {
  flex: 1;
  background: #2c3e50;
  color: #ddd;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.speed-btn:hover {
  background: #34495e;
}

.speed-btn.selected {
  border-color: #F1C40F;
  background: #34495e;
  color: #F1C40F;
}

.meteor-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(180deg, #c0392b 0%, #8e2618 100%);
  color: #fff;
  border: 2px solid #e67e22;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.7rem;
  line-height: 1.1;
  box-shadow: 0 0 8px rgba(230, 126, 34, 0.5);
  transition: transform 0.1s;
}

.meteor-btn:hover {
  transform: scale(1.04);
}

.meteor-btn:disabled {
  background: #555;
  border-color: #777;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.meteor-btn.armed {
  animation: meteor-pulse 0.7s ease-in-out infinite;
}

@keyframes meteor-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(230, 126, 34, 0.5); }
  50% { box-shadow: 0 0 16px rgba(243, 156, 18, 1); }
}

.meteor-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 3px #f39c12);
}

.meteor-label small {
  display: block;
  font-size: 0.75rem;
  color: #ffeaa7;
}

/* ゲームボード */
.board-wrapper {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  aspect-ratio: 14 / 10;
  touch-action: none;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #1a1a2e;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* オーバーレイ */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 30, 0.92);
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: overlay-appear 0.3s ease;
}

.game-overlay.active {
  display: flex;
}

@keyframes overlay-appear {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.overlay-content {
  text-align: center;
  padding: 1.5rem;
}

.overlay-content h2 {
  font-size: 1.75rem;
  color: #f1c40f;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 12px rgba(241, 196, 15, 0.5);
}

.overlay-content p {
  font-size: 1.1rem;
  color: #d4d4d4;
  margin-bottom: 0.75rem;
}

.overlay-content .best-result {
  font-size: 0.95rem;
  color: #F1C40F;
  font-weight: 600;
  margin-bottom: 1rem;
}

.overlay-content .btn-primary {
  margin-bottom: 0.5rem;
}

@media (max-width: 500px) {
  .meteor-btn {
    font-size: 0.65rem;
    padding: 0.3rem 0.4rem;
  }
  .meteor-icon { font-size: 1.1rem; }
  .game-hud { gap: 0.3rem; }
  .hud-item { padding: 0.25rem 0.3rem; }
  .hud-value { font-size: 0.9rem; }
}

@media (max-width: 360px) {
  .score-area { gap: 0.5rem; }
  .score-box { padding: 0.4rem 0.7rem; min-width: 55px; }
  .score-value { font-size: 1rem; }
  .tower-info { font-size: 0.55rem; }
  .speed-btn { font-size: 0.65rem; padding: 0.25rem; }
}
