/* The basics: colors, the page, buttons, and the top bar. The other style files, in the order
   index.html loads them: cards.css (cards and your hand), table.css (seats, name tags, piles),
   motion.css (bubbles, the dragged card, card flights), dialogs.css (settings, color picker, end
   screen), and dev.css (?dev only). */

* { box-sizing: border-box; }

/* Room is always kept for a scrollbar, so nothing on the table slides sideways when your hand
   grows long enough for the page to scroll */
html { scrollbar-gutter: stable; }

/* Something hidden stays hidden, whatever else its classes say */
[hidden] { display: none !important; }

:root {
  /* The four card colors */
  --red: #e8333a;
  --yellow: #ffd23f;
  --green: #2fb04a;
  --blue: #2f9be0;
  /* The rest */
  --yellow-ledge: #c9a227; /* the darker edge under a yellow button */
  --alert: #e6194b; /* a stack waiting, the player it's aimed at, bubbles, winning */
  --evolve: #8a4fff; /* evolutions and interruptions */
  --evolve-glow: #b77cff;
  --night: #1e2538; /* the bottom of the table, and text on the white panels */
  --dusk: #3a4766; /* the top of the table */
  --ink-on-yellow: #333;
  --switched-off: #c5cad6; /* a switch that's off */
  /* The card pictures' size, in pixels: the shape of every card */
  --card-image-width: 446;
  --card-image-height: 686;
}

/* A color's glow: the ring around a wild on the pile, a color bubble, a color picker button */
[data-color="red"] { --glow: var(--red); }
[data-color="yellow"] { --glow: var(--yellow); }
[data-color="green"] { --glow: var(--green); }
[data-color="blue"] { --glow: var(--blue); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  color: white;
  background: linear-gradient(to bottom, var(--dusk), var(--night));
  background-attachment: fixed;
}

.button {
  font: inherit;
  font-size: 1.2rem;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink-on-yellow);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--yellow-ledge);
}
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--yellow-ledge); }

/* A round button with just an icon, like the settings gear (as tall as the New Game button) */
.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
}
.icon-button svg { width: 28px; height: 28px; fill: var(--ink-on-yellow); }

/* Top bar: New Game in the top-left corner, settings in the top-right */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.controls .button { flex-shrink: 0; }

/* On big screens the top bar floats over the corners instead of taking a row of its own, so
   the whole table moves up (see table.css) */
@media (min-width: 900px) {
  .controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    pointer-events: none;
  }
  .controls .button { pointer-events: auto; }
}

/* Phones: smaller buttons */
@media (max-width: 640px) {
  .controls { padding: 12px; }
  .controls .button { font-size: 1rem; padding: 10px 20px; }
  .controls .icon-button { width: 39px; height: 39px; padding: 0; }
  .icon-button svg { width: 24px; height: 24px; }
}
