:root {
  color-scheme: light;
  --bg: #fff8e7;
  --surface: rgba(255, 255, 255, 0.9);
  --text: #221704;
  --muted: #73664b;
  --line: rgba(34, 23, 4, 0.12);
  --accent: #f2b705;
  --accent-strong: #9a6700;
  --red: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(145deg, rgba(242, 183, 5, 0.22), transparent 34%),
    linear-gradient(315deg, rgba(220, 38, 38, 0.08), transparent 38%),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.login-view {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 34px;
  align-items: center;
}

.login-view h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.6rem, 6.2vw, 6rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.intro {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.eyebrow {
  width: fit-content;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel,
.metric-card,
.warning {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 54px rgba(80, 52, 0, 0.09);
}

.panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
}

.warning {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: var(--muted);
}

.warning strong {
  color: var(--red);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 850;
}

.metric-card strong {
  font-size: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.prediction-list,
.draw-list,
.history-list,
.number-cloud,
.ticket-form,
.model-summary {
  display: grid;
  gap: 12px;
}

.prediction-card,
.draw-list article,
.saved-ticket,
.number-cloud article,
.model-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.66);
}

.prediction-card {
  display: grid;
  gap: 12px;
}

.prediction-card span,
.saved-ticket span,
.number-cloud span,
.empty {
  color: var(--muted);
}

.balls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ball {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
  font-weight: 950;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.number-inputs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.number-inputs input {
  text-align: center;
  font-weight: 900;
}

.number-cloud {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-summary article {
  display: grid;
  gap: 4px;
}

.model-summary span {
  color: var(--muted);
}

.model-summary strong {
  font-size: 1.4rem;
}

.confusion-matrix {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr;
  gap: 6px;
}

.confusion-matrix strong,
.confusion-matrix span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.roc-chart svg {
  width: 100%;
  min-height: 220px;
}

.roc-line {
  fill: none;
  stroke: var(--red);
  stroke-width: 4;
}

.roc-diagonal {
  stroke: rgba(34, 23, 4, 0.24);
  stroke-dasharray: 6 6;
  stroke-width: 2;
}

.roc-chart text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.number-cloud article {
  display: grid;
  gap: 4px;
}

.number-cloud strong {
  font-size: 1.6rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .login-view,
  .topbar,
  .grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .topbar,
  .warning {
    align-items: start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: stretch;
  }

  .actions > * {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .login-view h1 {
    font-size: clamp(2.3rem, 12vw, 4rem);
  }

  .number-inputs {
    grid-template-columns: repeat(3, 1fr);
  }
}
