/* === Reset & Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === Nav === */
nav {
  width: 100%;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
  display: flex;
  justify-content: center;
}
nav a {
  padding: .75rem 1.5rem;
  color: #a0a0b8;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: color .15s, border-color .15s;
  border-bottom: 2px solid transparent;
}
nav a:hover { color: #e0e0e0; }
nav a.active { color: #e94560; border-bottom-color: #e94560; }

/* === Layout === */
.layout {
  display: flex;
  width: 100%;
  max-width: 1000px;
  gap: 1.5rem;
  padding: 2rem 1rem;
  align-items: flex-start;
}
.page { flex: 1; min-width: 0; }

/* === Sidebar === */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.sidebar h3 {
  font-size: .85rem;
  color: #e94560;
  margin-bottom: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.rule {
  margin-bottom: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #0f346040;
}
.rule:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.rule-title { font-size: .75rem; font-weight: 600; color: #e0e0e0; margin-bottom: .25rem; }
.rule-text { font-size: .7rem; color: #a0a0b8; line-height: 1.5; }
.rule-text strong { color: #4ecca3; font-weight: 600; }
.rule-text .warn { color: #e94560; }

/* === Card === */
.card {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  margin-bottom: 1.5rem;
}

/* === Typography === */
h1 { font-size: 1.3rem; text-align: center; margin-bottom: 1.5rem; color: #e94560; }
h2 { font-size: 1rem; margin-bottom: 1rem; color: #a0a0b8; }
label { display: block; font-size: .85rem; margin-bottom: .3rem; color: #a0a0b8; }

/* === Form Controls === */
input, textarea {
  width: 100%;
  padding: .6rem .8rem;
  margin-bottom: 1rem;
  border: 1px solid #0f3460;
  border-radius: 6px;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 1.1rem;
  outline: none;
}
textarea {
  height: 150px;
  padding: .8rem;
  font-family: inherit;
  font-size: .95rem;
  resize: vertical;
}
input:focus, textarea:focus { border-color: #e94560; }
textarea::placeholder { color: #555; }

/* === Buttons === */
.btn-row { display: flex; gap: .75rem; margin-top: 1rem; }
.btn {
  flex: 1;
  padding: .6rem;
  border: 1px solid #0f3460;
  border-radius: 6px;
  background: transparent;
  color: #a0a0b8;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover { background: #0f3460; color: #e0e0e0; }
.btn-primary { background: #e94560; border-color: #e94560; color: #fff; }
.btn-primary:hover { background: #c7354e; }

/* === Copied Badge === */
.copied {
  position: absolute;
  top: .4rem;
  right: .6rem;
  font-size: .7rem;
  color: #4ecca3;
  opacity: 0;
  transition: opacity .2s;
}
.copied.show { opacity: 1; }

/* === Result / Pick === */
.result, .pick-result {
  text-align: center;
  padding: 1rem;
  background: #0f3460;
  border-radius: 8px;
  margin-top: .5rem;
  cursor: pointer;
  transition: background .15s;
  position: relative;
}
.result:hover, .pick-result:hover { background: #133a6e; }
.pick-result { margin-top: 1rem; }
.result-label, .pick-label { font-size: .8rem; color: #a0a0b8; }
.result-value, .pick-value {
  font-size: 2rem;
  font-weight: 700;
  color: #e94560;
  margin-top: .25rem;
}
.pick-value { color: #4ecca3; }
.profit { color: #4ecca3; }
.loss { color: #e94560; }

/* === Stats === */
.stats { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stat {
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: .6rem 1rem;
  text-align: center;
  flex: 1;
  min-width: 80px;
}
.stat-val { font-size: 1.5rem; font-weight: 700; color: #e94560; }
.stat-label { font-size: .7rem; color: #a0a0b8; margin-top: .2rem; }

/* === Number Grid === */
.num-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-bottom: 1.5rem;
}
.num {
  padding: .4rem;
  text-align: center;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 500;
  background: #0f3460;
  color: #e0e0e0;
  cursor: pointer;
  transition: background .15s, transform .1s;
  user-select: none;
}
.num:hover { transform: scale(1.1); }
.num.taken { background: #2a1a2e; color: #555; cursor: default; text-decoration: line-through; }
.num.taken:hover { transform: none; }
.num.dup { background: #4a1a1e; color: #e94560; text-decoration: line-through; }
.num.selected { background: #4ecca3; color: #1a1a2e; font-weight: 700; }
.pick-section { margin-top: 1.5rem; border-top: 1px solid #0f3460; padding-top: 1.5rem; }

/* === Result Cards === */
.result-card { display: none; }
.result-card.visible { display: block; }
.results { display: none; }
.results.visible { display: block; }
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.result-header h1 { margin-bottom: 0; }
.entry-count {
  font-size: .75rem;
  font-weight: 600;
  color: #4ecca3;
  background: rgba(78,204,163,.15);
  padding: .3rem .75rem;
  border-radius: 12px;
}
.output-box {
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  padding: 1rem;
  min-height: 80px;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: .9rem;
  line-height: 1.7;
  color: #e0e0e0;
}
.empty { color: #555; font-style: italic; }

/* === Taken List === */
.taken-list { margin-bottom: 1rem; }
.taken-player { font-size: .8rem; color: #a0a0b8; padding: .3rem 0; border-bottom: 1px solid #0f346030; }
.taken-player span { color: #e0e0e0; }
.taken-player .dup-flag { color: #e94560; font-size: .7rem; font-weight: 600; }

/* === Responsive === */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; max-height: none; }
}
