/* Star Shooter - 星際射手樣式 */
/* 共用變數參考首頁 css/style.css */

:root {
  --bg: #0d0a1a;
  --bg-elevated: #16102e;
  --fg: #f0eef5;
  --muted: #9a94b5;
  --accent: #ff6b4a;
  --accent-glow: #ff9e7d;
  --accent2: #4af5a8;
  --card-bg: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --focus: #ffd166;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3f8;
    --bg-elevated: #ffffff;
    --fg: #2b2350;
    --muted: #6b5f8a;
    --accent: #e85d3a;
    --accent-glow: #ff8c6b;
    --accent2: #2ec47a;
    --card-bg: rgba(0,0,0,0.03);
    --border: rgba(0,0,0,0.06);
    --focus: #d4a000;
  }
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--accent); color: #000; padding: 0.5rem 1rem;
  border-radius: var(--radius-sm); z-index: 10000;
  transition: top var(--transition);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Header */
.page-header {
  padding: 1.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg));
}

.header-inner { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--fg); font-weight: 700; font-size: 1.25rem; }
.brand-mark { font-size: 1.5rem; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.page-header h1 {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main */
main.wrap { flex: 1; padding: 1.5rem 1rem; max-width: 900px; margin: 0 auto; width: 100%; }

/* Game Area */
.game-area { margin-bottom: 2rem; }

.canvas-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--border), 0 8px 32px rgba(0,0,0,0.4); aspect-ratio: 3/4; max-width: 600px; margin: 0 auto; }

#game-canvas {
  display: block; width: 100%; height: 100%;
  touch-action: none; /* 防止頁面滾動 */
  background: #000;
}

/* Overlay */
.overlay {
  position: absolute; inset: 0;
  background: rgba(13,10,26,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; z-index: 10;
  backdrop-filter: blur(4px);
}
.overlay.hidden { display: none; }

.overlay-content { text-align: center; max-width: 90%; }

.overlay-content h2 {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.overlay-content p { color: var(--muted); margin-bottom: 1.5rem; font-size: 1.1rem; }

.overlay-controls { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }

.btn {
  padding: 0.875rem 2rem; border-radius: var(--radius); border: none; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  min-height: 48px; min-width: 120px;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.btn.primary { background: linear-gradient(135deg, var(--accent), #e85d3a); color: #fff; box-shadow: 0 4px 16px rgba(255,107,74,0.4); }
.btn.primary:hover { box-shadow: 0 6px 24px rgba(255,107,74,0.5); }

.btn.secondary { background: var(--card-bg); color: var(--fg); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg-elevated); }

.controls-hint { font-size: 0.85rem; color: var(--muted); line-height: 1.8; }

/* HUD */
.hud {
  display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap;
  margin-top: 1rem; padding: 0.75rem 1rem;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  font-family: "JetBrains Mono", "Fira Code", monospace;
}
.hud-item { display: flex; align-items: center; gap: 0.5rem; }
.hud-label { color: var(--muted); font-size: 0.875rem; }
.hud-value { color: var(--accent-glow); font-weight: 700; font-size: 1.1rem; min-width: 3ch; }
#hud-lives { font-family: "Noto Sans TC", "Apple Color Emoji", sans-serif; font-size: 1.25rem; }
#hud-power { color: var(--accent2); }

/* Info Section */
.info-section { margin-bottom: 2rem; }
.controls-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.control-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem;
}
.control-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--accent); }
.control-card ul { list-style: none; font-size: 0.9rem; color: var(--muted); line-height: 2; }
.control-card kbd {
  display: inline-block; padding: 0.15rem 0.45rem; margin: 0 0.15rem;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px;
  font-family: inherit; font-size: 0.85em; color: var(--fg); box-shadow: 0 1px 0 var(--border);
}

/* Tech Section */
.tech-section { border-top: 1px solid var(--border); padding-top: 1.5rem; }
.tech-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem 2rem; font-size: 0.9rem; }
.tech-list dt { color: var(--muted); font-weight: 500; }
.tech-list dd { color: var(--fg); margin-left: 0; }

/* Footer */
.page-footer { padding: 1.5rem 1rem; text-align: center; border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner a { color: var(--accent); text-decoration: none; font-weight: 500; }
.footer-inner a:hover { text-decoration: underline; }
.footer-inner p:last-child { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .brand-mark { animation: none; }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .hud { gap: 1rem; padding: 0.5rem; }
  .hud-label { display: none; }
  .hud-value { font-size: 1rem; }
  .btn { padding: 0.75rem 1.5rem; min-width: 100px; }
  .controls-grid { grid-template-columns: 1fr; }
}