/* ent8.yaka.fr — the whole stylesheet.
 *
 * Ported from the legacy `src/css/_z.scss` (the `.zf-*` sizes, the gradients, the Pure grid
 * fractions) and from the component-scoped rules of `src/components/*.vue` (the box, the deal
 * diagram, the 80 px orientation square, the hand typography). The values are the legacy ones;
 * the selectors are what the Ziex markup emits (`PLAN-ZIG.md` § 4, task 10).
 */

/* --- base ----------------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #212121;
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

/* --- the six sizes of `_z.scss` -------------------------------------------------------------- */

.zf-1 { font-size: 3rem; }
.zf-2 { font-size: 2.4rem; }
.zf-3 { font-size: 1.8rem; }
.zf-4 { font-size: 1.4rem; }
.zf-5 { font-size: 1.2rem; }
.zf-6 { font-size: 1rem; }

.text-center { text-align: center; }

/* --- the gradients and the borders ------------------------------------------------------------ */

.zbg-green-blue {
  background-image: linear-gradient(141deg, #009e6c 0, #00d1b2 71%, #00e7eb 100%);
}

.zbg-orange-yellow {
  background-image: linear-gradient(141deg, #f57c00 0, #ffe0b2 100%);
}

.zbg-yellow-orange {
  background-image: linear-gradient(141deg, #ffe0b2 0, #f57c00 100%);
}

.zbo-grey { border: 1px solid #cccccc; }
.zbo-orange { border: 1px solid #f5a000; }

/* --- the page, its bar, and the cards --------------------------------------------------------- */

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
}

.bar {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #fff;
  border-radius: 0.5rem;
}

.bar h1 {
  margin: 0;
}

.card {
  overflow: hidden;
  background: #fff;
  border-radius: 0.5rem;
}

.card-head {
  padding: 0.5rem 1rem;
}

.card-head .zf-4 {
  padding-top: 0.25rem;
}

.desc {
  padding: 0.5rem 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1rem;
}

.button {
  display: inline-block;
  padding: 0.35rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: #212121;
  background: #e0e0e0;
  border: 1px solid #b8c2cc;
  border-radius: 0.25rem;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: #4caf50;
  border-color: #388e3c;
}

/* --- `/`: the six systems -------------------------------------------------------------------- */

.systems {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card.system {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1rem;
}

.card.system .players {
  flex: 1;
  padding: 0 1rem;
  margin: 0;
  list-style: none;
}

.card.system .button {
  align-self: center;
}

/* --- `/syst/<id>`: the bids ------------------------------------------------------------------- */

.bids {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* --- the board grid: only the fractions the markup names -------------------------------------- */

.zw-1 { width: 100%; }

@media screen and (min-width: 576px) {
  .zw-sm-1-2 { width: 50%; }
}

@media screen and (min-width: 992px) {
  .zw-lg-1-3 { width: 33.3333%; }
}

@media screen and (min-width: 1200px) {
  .zw-xl-1-4 { width: 25%; }
}

.boards {
  display: flex;
  flex-wrap: wrap;
}

.boite {
  padding: 0.35rem;
  break-inside: avoid;
}

/* The box of one board, from `deal-list.vue`. It is also a container: the diagram's type scales
 * with the box, never with the viewport, because a box is 25 % wide at 1400 px and 100 % at
 * 390 px. Without this the 13 cards of a hand are wider than their slot at four columns (the
 * legacy spilled across the orientation square and the page). */
.boite > .main {
  padding: 0.5rem;
  background-color: #dae1e7;
  border: 1px solid #b8c2cc;
  border-radius: 0.5rem;
  container-type: inline-size;
}

/* --- the diagram, from `deal.vue` and `hand.vue` ---------------------------------------------- */

.deal {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* N above and S below sit in the 60 % slot, as the legacy `.zw-40` spacer made them. */
.deal > .north,
.deal > .south {
  display: flex;
}

.deal > .north > .spacer,
.deal > .south > .spacer {
  flex: 0 0 40%;
}

.deal > .north > .hand-slot,
.deal > .south > .hand-slot {
  flex: 1 1 auto;
  min-width: 0;
}

.deal > .middle {
  display: flex;
  align-items: center;
}

.deal .west,
.deal .east {
  flex: 1 1 0;
  min-width: 0;
}

.deal .west {
  padding-right: 0.25rem;
}

.deal .east {
  padding-left: 0.25rem;
}

.orientation {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  padding-top: 0.5em;
  color: #fff;
  background-color: #2e7d32;
  border: 1px solid #b8c2cc;
  border-radius: 0.5rem;
  font-size: clamp(0.9rem, 4cqw, 1.4rem);
  line-height: 0.5em;
  text-align: center;
}

.hand p {
  margin: 0;
  font-family: "Roboto Mono", monospace;
  font-size: clamp(0.62rem, 3.7cqw, 1.2rem);
  line-height: 1.5em;
  white-space: nowrap;
}

.hand .suit {
  padding-right: 0.25em;
}

.hand .suit.red {
  color: hsl(348, 100%, 61%);
}

.hand .ls {
  letter-spacing: clamp(0.3px, 0.28cqw, 0.5rem);
}

/* `T` is printed `10` plus a non-breaking space, and must not inherit the card spacing. */
.hand .ten {
  letter-spacing: normal;
}

/* The legacy `v-if` removed the hand from the flow; `display: none` does the same for a flex
 * item, and the `<noscript>` in the layout beats this rule with `!important` (task 9). */
.off {
  display: none;
}

/* --- the island: the toolbar, the per-board filters, the carousel ------------------------------ */

.island {
  margin-top: 0.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.35rem;
}

.toolbar .mode {
  color: #fff;
  background: #4caf50;
  border-color: #388e3c;
}

.details {
  display: block;
  width: 100%;
  margin: 0.25rem 0;
  font-size: 0.95rem;
  color: #fff;
  background: #4caf50;
  border: 1px solid #388e3c;
  border-radius: 0.25rem;
  cursor: pointer;
}

.filtres {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.filtres button {
  flex: 1 1 0;
  padding: 0.2rem 0;
  font-family: inherit;
  font-size: 0.9rem;
  color: #fff;
  background: #78909c;
  border: 1px solid #546e7a;
  border-radius: 0.25rem;
  cursor: pointer;
}

.one {
  padding: 0.35rem;
}

.one > .one-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  max-width: 700px;
  margin: 0 auto;
  padding: 0.25rem 0.35rem;
}

.one-nav {
  display: flex;
  gap: 0.5rem;
}

.one-nav .button {
  font-size: 1.2rem;
  line-height: 1;
}

.one > .boite {
  width: 100%;
  /* Wide enough for the full-size hand: 2 × (13 cards at 1.2rem with 0.5rem spacing) + the
   * 80 px square (the container query clamps the type at this width). */
  max-width: 700px;
  margin: 0 auto;
}

/* --- narrow screens: the page chrome shrinks; the diagram already follows its container ------ */

@media screen and (max-width: 480px) {
  .zf-2 { font-size: 1.8rem; }
  .zf-3 { font-size: 1.5rem; }
}
