/* MTG Star Trek Deck Analyzer Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f8f9fa;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 1.5rem 0;
  border-bottom: 4px solid #e94560;
}
header h1 { font-size: 1.8rem; margin-bottom: 0.3rem; }
header .tagline { font-size: 0.95rem; opacity: 0.9; }
nav { display: flex; gap: 1.5rem; margin-top: 0.5rem; }
nav a { color: #fff; text-decoration: none; opacity: 0.9; font-size: 0.9rem; transition: opacity 0.2s; }
nav a:hover { opacity: 1; }
.hero { background: #fff; padding: 2rem 0; }
.input-group { margin-bottom: 1.5rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: #333; }
#decklist { width: 100%; padding: 1rem; border: 2px solid #e0e0e0; border-radius: 8px; font-family: monospace; font-size: 0.95rem; resize: vertical; }
#decklist:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); }
.help-text { font-size: 0.8rem; color: #666; margin-top: 0.25rem; }
.presets { background: #f8f9fa; padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.presets fieldset { border: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.presets legend { font-weight: 600; color: #555; margin-right: 1rem; }
.presets select, .presets button { padding: 0.5rem 0.75rem; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; }
.presets button { background: #007bff; color: #fff; border-color: #007bff; }
.presets button:hover { background: #0056b3; }
.controls { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.controls button { padding: 0.75rem 1.25rem; border: none; border-radius: 8px; cursor: pointer; font-weight: 500; }
#analyze-btn { background: #e94560; color: #fff; }
#analyze-btn:hover { background: #c7384f; }
#save-deck { background: #28a745; color: #fff; }
#save-deck:hover { background: #218838; }
#saved-decks { padding: 0.75rem; border-radius: 8px; border: 1px solid #ccc; background: #fff; }
.results { background: #fff; padding: 2rem 0; }
.score-card { text-align: center; margin-bottom: 2rem; }
.score-value { font-size: 4rem; font-weight: 700; color: #e94560; }
.score-label { font-size: 1.1rem; color: #666; margin-top: 0.25rem; }
.score-note { font-size: 0.85rem; color: #888; margin-top: 0.5rem; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.metric-card { background: #f8f9fa; padding: 1.25rem; border-radius: 12px; border-left: 4px solid #007bff; }
.metric-card h3 { font-size: 1rem; margin-bottom: 0.75rem; color: #333; }
#mana-curve-visual, #color-pie-chart, #budget-rating { font-size: 1.5rem; font-weight: 600; text-align: center; padding: 1rem; background: #fff; border-radius: 8px; }
.gaps-section, .upgrades-section { margin: 2rem 0; }
.gaps-section h3, .upgrades-section h3 { margin-bottom: 1rem; color: #333; }
#missing-pieces { list-style: none; }
#missing-pieces li { padding: 0.75rem; margin: 0.25rem 0; background: #fff; border-radius: 6px; border-left: 3px solid #ffc107; }
#upgrades-table { width: 100%; border-collapse: collapse; }
#upgrades-table th, #upgrades-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid #eee; }
#upgrades-table th { background: #f8f9fa; font-weight: 600; }
.export-controls { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.export-controls button { flex: 1; min-width: 120px; padding: 0.75rem; border: none; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
#copy-results { background: #17a2b8; color: #fff; }
#print-results { background: #6c757d; color: #fff; }
#share-url { background: #28a745; color: #fff; }
.about-analyzer { background: #fff; padding: 2rem 0; }
.about-analyzer h2 { margin-bottom: 1rem; color: #1a1a2e; }
.about-analyzer p, .about-analyzer li { margin-bottom: 0.75rem; color: #444; }
.about-analyzer table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.about-analyzer th, .about-analyzer td { padding: 0.75rem; border: 1px solid #ddd; text-align: left; }
.about-analyzer th { background: #f8f9fa; }
.last-updated { text-align: center; margin-top: 2rem; padding: 1rem; background: #e9ecef; border-radius: 8px; font-size: 0.85rem; color: #666; }
footer { background: #1a1a2e; color: #aaa; padding: 1.5rem 0; border-top: 1px solid #333; }
footer a { color: #aaa; text-decoration: none; }
footer a:hover { text-decoration: underline; }
@media (max-width: 768px) {
  header h1 { font-size: 1.4rem; }
  nav { flex-direction: column; gap: 1rem; }
  .input-group label { font-size: 0.95rem; }
  #decklist { font-size: 0.9rem; padding: 0.75rem; }
  .presets fieldset { flex-direction: column; align-items: stretch; }
  .presets legend { margin-bottom: 0.5rem; }
  .presets select, .presets button { width: 100%; }
  .controls { flex-direction: column; }
  .metrics-grid { grid-template-columns: 1fr; }
  .export-controls button { width: 100%; }
  .about-analyzer table { font-size: 0.85rem; }
  .about-analyzer th, .about-analyzer td { padding: 0.5rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 0.5rem; }
  header { padding: 1rem 0; }
  .hero, .results, .about-analyzer { padding: 1rem 0; }
  .score-value { font-size: 3rem; }
}
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* Ad space styling */
.ad-reserve { background: #f0f0f0; border: 1px dashed #ccc; border-radius: 8px; min-height: 120px; display: flex; align-items: center; justify-content: center; color: #888; font-size: 0.9rem; margin: 1rem 0; }
.ad-reserve.ad-visible { background: #fff; border-color: #e94560; }
/* Error styling */
#decklist.error { border-color: #dc3545; }
#decklist.error:focus { box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25); }
.error-message { color: #dc3545; font-size: 0.85rem; margin-top: 0.25rem; }



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
