* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #07090f;
  font-family: 'Segoe UI', sans-serif;
}

body.game-mode {
  overflow: hidden;
}

#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  align-items: center;
  gap: 8px;
}

canvas {
  border: 3px solid #2d3a4a;
  border-radius: 4px;
  display: block;
  background: #87CEEB;
}

#controls-hint {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: #888;
}

#controls-hint .p1-hint {
  color: #3498db;
}

#controls-hint .p2-hint {
  color: #e74c3c;
}

#controls-hint .global-hint {
  color: #aaa;
}

/* ===================== 首页科技风格 ===================== */

#home {
  width: 100%;
  min-height: 100vh;
  background: #07090f;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  font-family: 'Courier New', 'Consolas', monospace;
}

/* 背景网格 */
#home::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 245, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* 扫描线 */
#home::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  pointer-events: none;
  z-index: 0;
}

#home > * {
  position: relative;
  z-index: 1;
}

/* 顶部装饰线 */
.home-top-bar {
  width: 100%;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.12);
  background: rgba(0, 245, 255, 0.02);
}

.home-top-bar::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #00f5ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00f5ff, 0 0 16px #00f5ff;
  animation: pulse-dot 2s ease-in-out infinite;
}

.home-top-bar span {
  color: rgba(0, 245, 255, 0.5);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

#sys-time {
  color: rgba(0, 245, 255, 0.35);
  font-size: 11px;
  letter-spacing: 2px;
  margin-left: auto;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #00f5ff, 0 0 16px #00f5ff; }
  50% { opacity: 0.4; box-shadow: 0 0 3px #00f5ff; }
}

/* 头部 */
#home header {
  width: 100%;
  padding: 52px 40px 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#home header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00f5ff, transparent);
}

.logo {
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo-icon {
  font-size: 52px;
  filter: drop-shadow(0 0 12px rgba(0, 245, 255, 0.6));
}

.logo-text {}

.logo h1 {
  color: #e8f8ff;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
}

.logo .subtitle {
  color: #00f5ff;
  font-size: 12px;
  letter-spacing: 6px;
  opacity: 0.7;
}

/* 主内容 */
#home main {
  width: 100%;
  max-width: 1140px;
  padding: 0 40px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.section-header::before {
  content: '//';
  color: #00f5ff;
  font-size: 14px;
  opacity: 0.6;
  letter-spacing: 2px;
}

.section-title {
  color: #c8e8ff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 245, 255, 0.3), transparent);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* 游戏卡片 */
.game-card {
  background: rgba(8, 16, 28, 0.8);
  border: 1px solid rgba(0, 245, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* 卡片左上角装饰 */
.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-top: 2px solid rgba(0, 245, 255, 0.4);
  border-left: 2px solid rgba(0, 245, 255, 0.4);
  z-index: 2;
  transition: border-color 0.25s ease;
}

.game-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid rgba(0, 245, 255, 0.4);
  border-right: 2px solid rgba(0, 245, 255, 0.4);
  z-index: 2;
  transition: border-color 0.25s ease;
}

.game-card.available {
  cursor: pointer;
}

.game-card.available:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 245, 255, 0.5);
  box-shadow:
    0 0 30px rgba(0, 245, 255, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-card.available:hover::before,
.game-card.available:hover::after {
  border-color: #00f5ff;
}

.game-card.available:active {
  transform: translateY(-3px);
}

.game-card.locked {
  opacity: 0.45;
}

/* 卡片缩略图 */
.card-thumb {
  height: 148px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(8, 16, 28, 0.9) 100%);
}

.thumb-icon {
  font-size: 52px;
  opacity: 0.65;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.3));
}

.thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 52px;
  height: 52px;
  background: rgba(0, 245, 255, 0.12);
  border: 2px solid #00f5ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #00f5ff;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2;
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.3), inset 0 0 12px rgba(0, 245, 255, 0.1);
}

.game-card.available:hover .thumb-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}


/* 卡片内容 */
.card-body {
  padding: 18px 20px 16px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.card-number {
  font-size: 10px;
  color: #00f5ff;
  letter-spacing: 3px;
  opacity: 0.7;
}

.card-dot {
  width: 3px;
  height: 3px;
  background: rgba(0, 245, 255, 0.4);
  border-radius: 50%;
}

.card-body h3 {
  color: #e0f4ff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: 'Segoe UI', sans-serif;
}

.card-body p {
  color: rgba(150, 190, 220, 0.6);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 14px;
  font-family: 'Segoe UI', sans-serif;
}

.card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tag {
  background: rgba(0, 245, 255, 0.07);
  border: 1px solid rgba(0, 245, 255, 0.2);
  color: rgba(0, 245, 255, 0.7);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 245, 255, 0.07);
}

.status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 1px;
}

.status.ready {
  background: rgba(0, 245, 255, 0.1);
  color: #00f5ff;
  border: 1px solid rgba(0, 245, 255, 0.3);
}

.status.locked {
  background: rgba(255, 255, 255, 0.03);
  color: rgba(150, 150, 150, 0.5);
  border: 1px solid rgba(150, 150, 150, 0.1);
}

.btn-play {
  font-size: 12px;
  color: rgba(0, 245, 255, 0.6);
  font-weight: 700;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  transition: color 0.2s, text-shadow 0.2s;
}

.game-card.available:hover .btn-play {
  color: #00f5ff;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.6);
}

/* 页脚 */
#home footer {
  margin-top: 80px;
  padding: 24px 40px;
  border-top: 1px solid rgba(0, 245, 255, 0.06);
  width: 100%;
  display: flex;
  justify-content: center;
}

#home footer p {
  color: rgba(100, 130, 160, 0.4);
  font-size: 11px;
  letter-spacing: 3px;
}

/* 响应式 */
@media (max-width: 700px) {
  .logo h1 { font-size: 22px; letter-spacing: 2px; }
  .logo-icon { font-size: 36px; }
  .logo { gap: 16px; }
  #home main { padding: 0 16px; }
  #home header { padding: 36px 20px 32px; }
  .home-top-bar { padding: 12px 20px; }
  .game-grid { grid-template-columns: 1fr; }
  #home footer { padding: 20px; }
}
