/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; line-height: 1.5; color: #1a1a1a; background: #f5f7fa; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Header */
header { background: #0b3d5f; color: white; padding: 1rem 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.logo { font-size: 1.4rem; font-weight: bold; text-decoration: none; color: white; }
header nav { display: flex; gap: 1.5rem; }
header nav a { color: #cce5ff; text-decoration: none; font-weight: 500; }
header nav a:hover { text-decoration: underline; }

/* Hero */
.hero { text-align: center; padding: 2rem 0 1rem; }
.hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; color: #0b3d5f; }
.hero p { font-size: 1.1rem; max-width: 700px; margin: 0 auto; color: #334; }

/* Simulator layout */
.simulator { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 2rem 0; }
@media (max-width: 768px) { .simulator { grid-template-columns: 1fr; } }
.controls-panel, .results-panel { background: white; border-radius: 10px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* Controls */
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
input[type="range"] { width: 100%; }
.value-display { display: inline-block; background: #e9ecef; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.9rem; margin-left: 0.5rem; }
select { width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; background: white; }

#sports-allocation { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.sport-row { display: flex; align-items: center; gap: 0.5rem; }
.sport-row label { flex: 1; font-weight: 500; }
.sport-row input[type="range"] { flex: 2; }
.sport-row .sport-points { width: 3rem; text-align: right; font-weight: bold; }

.allocation-summary { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-primary { background: #0b3d5f; color: white; border: none; padding: 0.6rem 1.2rem; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-primary:hover { background: #0a3450; }
.btn-secondary { background: #e9ecef; color: #333; border: 1px solid #ccc; padding: 0.6rem 1.2rem; border-radius: 6px; cursor: pointer; font-weight: 500; }
.btn-secondary:hover { background: #dde1e5; }

/* Results */
#medal-output table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
#medal-output th, #medal-output td { padding: 0.5rem; text-align: left; border-bottom: 1px solid #eee; }
#medal-output th { background: #f0f4f8; font-weight: 600; }
.placeholder { color: #777; font-style: italic; }
.result-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }

/* Saved scenarios */
.saved-scenarios { background: white; border-radius: 10px; padding: 1.5rem; margin: 2rem 0; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.saved-scenarios h2 { margin-bottom: 1rem; }
.saved-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #eee; }
.saved-item button { background: none; border: none; color: #c00; cursor: pointer; }

/* Supporting content */
.supporting-content { background: white; border-radius: 10px; padding: 2rem; margin: 2rem 0; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.supporting-content h2 { margin: 1.5rem 0 0.5rem; color: #0b3d5f; }
.supporting-content h2:first-child { margin-top: 0; }
.supporting-content ul { padding-left: 1.5rem; margin: 0.5rem 0; }
.supporting-content li { margin-bottom: 0.3rem; }

/* Footer */
footer { background: #0b3d5f; color: #cce5ff; padding: 1.5rem 0; text-align: center; margin-top: 3rem; }
footer a { color: white; }

/* Responsive */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .controls-panel, .results-panel { padding: 1rem; }
  .sport-row { flex-wrap: wrap; }
}



/* 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;
}
