/* styles.css is what the plinko page adds to the shared theme
   (web/sdk/theme.css, docs/design/ui.md), after mines (G700) and the coin
   flip (G701): the board's stage, the canvas and the rows/risk pickers in the
   bet panel. The header, the bet panel, the toast, the history, the fairness
   panel and the layout are the theme's; colours, durations and radii are its
   tokens. The canvas paints in the same tokens (board.js inkFrom); app.js
   sizes it to the stage and the pixel ratio. */

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-16);
  line-height: var(--lh);
}

h1,
h2 {
  margin: 0;
}

.side h2 {
  font-size: var(--fs-14);
  color: var(--muted);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* The header carries Exit after "Fairness": the balance and both buttons
   sit together on the right. */
.app > header .balance {
  margin-left: auto;
}

/* ---- board ------------------------------------------------------------ */

.board {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.board-stage {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.board-stage.win {
  border-color: var(--win);
  box-shadow: 0 0 var(--space-5) var(--win);
}

.board-stage.lose {
  border-color: var(--lose);
}

.board-canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  border-radius: var(--radius);
}

.result {
  margin: 0;
  min-height: 1.5em;
  text-align: center;
  font-size: var(--fs-20);
  font-weight: 600;
}

.result.win {
  color: var(--win);
}

.result.lose {
  color: var(--muted);
}

.error {
  margin: 0;
  color: var(--lose);
  text-align: center;
}

.notice {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-2);
}

.closed {
  text-align: center;
}

/* ---- rows and risk ---------------------------------------------------- */

.choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.choice select {
  width: 100%;
  min-height: 40px;
  padding: 0 var(--space-2);
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.choice select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.choice select:disabled {
  opacity: 0.6;
}

/* ---- widths ----------------------------------------------------------- */

@media (max-width: 767px) {
  .board-stage {
    max-width: none;
  }

  .choice select {
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  /* The theme pins the bet panel to the bottom; rows and risk make it a row
     taller than the other pages'. */
  .app {
    padding-bottom: 380px;
  }

  .app > header .btn {
    padding-inline: var(--space-2);
  }

  .choice {
    gap: var(--space-1);
  }

  .choice select {
    min-height: 40px;
    font-size: var(--fs-14);
  }

  .result {
    font-size: var(--fs-16);
  }
}
