/* Sudoku Cosmos: continues css/03-game.css (same cascade order). */
/* ---- under (or beside) the board ---- */
.deck {
  position: relative;
  z-index: 0;
  width: calc(93 * var(--u));
  height: calc(48 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(2.2 * var(--u));
  flex: none;
}
.deck::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: calc(-2 * var(--u)) calc(-3.5 * var(--u)) calc(8 * var(--u));
  border-radius: calc(5 * var(--u));
  background: linear-gradient(
    rgba(16, 18, 58, 0),
    rgba(16, 18, 58, 0.5) 16%,
    rgba(16, 18, 58, 0.5) 84%,
    rgba(16, 18, 58, 0)
  );
  pointer-events: none;
}
.info {
  height: calc(5 * var(--u));
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: none;
}
.chip {
  --nine: pill;
  --slice: 76 104 76 104;
  height: 100%;
  padding: 0 calc(3 * var(--u));
  display: flex;
  align-items: center;
  font-size: calc(3.4 * var(--u));
  font-weight: 500;
  color: #e3e9ff;
  padding-bottom: calc(0.35 * var(--u));
}
.chip:empty {
  visibility: hidden;
}
.lesson .info,
.hinting .info {
  display: none;
}
.hinting .deck {
  height: auto;
  min-height: calc(48 * var(--u));
}
.tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(1.6 * var(--u));
  flex: none;
}
.tool span {
  white-space: nowrap;
}
.tool {
  --h: calc(14 * var(--u));
  position: relative;
  height: var(--h);
  padding-bottom: calc(var(--h) * 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(0.2 * var(--u));
  font-size: calc(3.4 * var(--u));
  font-weight: 600;
  text-transform: uppercase;
  color: #fff;
}
.tool .ic {
  width: calc(6.6 * var(--u));
  height: calc(6.6 * var(--u));
}
.tool:disabled .ic,
.tool:disabled span {
  opacity: 0.72;
}
.tool em {
  position: absolute;
  top: calc(-2 * var(--u));
  right: calc(-1 * var(--u));
  min-width: calc(7 * var(--u));
  padding: calc(0.3 * var(--u)) calc(1.6 * var(--u));
  border-radius: calc(3 * var(--u));
  background: #171a45;
  box-shadow: inset 0 0 0 calc(0.3 * var(--u)) #5057b8;
  color: var(--soft);
  font-style: normal;
  font-size: calc(2.7 * var(--u));
  text-align: center;
  z-index: 2;
}
.tool.on {
  --nine: btn-amber;
  color: #07173f;
}
.tool.on .ic {
  filter: brightness(0.1);
}
.tool.on em {
  box-shadow: inset 0 0 0 calc(0.3 * var(--u)) var(--gold);
  color: var(--gold);
}
.tool.glow::after {
  content: '';
  position: absolute;
  inset: calc(-0.4 * var(--u));
  border-radius: calc(3.4 * var(--u));
  box-shadow:
    0 0 0 calc(0.7 * var(--u)) var(--gold),
    0 0 calc(4 * var(--u)) rgba(60, 230, 255, 0.9);
  animation: breathe 1.3s ease-in-out infinite;
  pointer-events: none;
}
.calm .tool.glow::after {
  animation: none;
}
.lesson .tool:not(.glow) {
  filter: saturate(0.45) brightness(0.55);
  pointer-events: none;
}
.lesson .card {
  min-height: calc(26 * var(--u));
}
.tool.breathe {
  animation: breathe 1.6s ease-in-out infinite;
}
.pad {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: calc(0.8 * var(--u));
  flex: none;
}
.key {
  --nine: btn-navy;
  --slice: 44 64 50 64;
  --edge: 2.5;
  filter: brightness(1.46) saturate(1.05);
  --h: calc(15 * var(--u));
  height: var(--h);
  padding-bottom: calc(0.5 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.key b {
  font-size: calc(7.4 * var(--u));
  font-weight: 500;
  line-height: 1;
}
.key small {
  height: calc(3.4 * var(--u));
  font-size: calc(3.1 * var(--u));
  font-weight: 500;
  color: #d5dcff;
}
.key.done b,
.key.done small {
  opacity: 0.25;
}
.key.armed {
  --nine: btn-amber;
  color: #07173f;
}
.key.armed small {
  color: #07173f;
}

/* ---- hint and lesson card ---- */
.card {
  --nine: card;
  --slice: 40 40 40 40;
  --edge: 3.4;
  flex: 0 0 auto;
  min-height: calc(36 * var(--u));
  padding: calc(3.4 * var(--u)) calc(4.2 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(1.6 * var(--u));
}
.card-head {
  display: flex;
  align-items: center;
  gap: calc(2.4 * var(--u));
}
#card-title {
  white-space: nowrap;
  font-size: calc(6.1 * var(--u));
  font-weight: 600;
  color: var(--gold);
}
#card-count {
  font-size: calc(4 * var(--u));
  font-weight: 500;
  margin-left: auto;
}
.card .x {
  position: relative; /* in the flow of the card head, and the anchor of its own touch area */
  top: auto;
  right: auto;
}
#card-text {
  margin: 0;
  flex: 1 0 auto;
  font-size: calc(3.95 * var(--u));
  font-weight: 400;
  line-height: 1.34;
}
.card-btns .btn.sm {
  --h: calc(9.8 * var(--u));
  font-size: calc(4.1 * var(--u));
}
/* card and number pad together (a lesson question): everything gets compact so both fit under the board */
.card.with-pad {
  min-height: 0;
  padding: calc(2.6 * var(--u)) calc(4 * var(--u));
  gap: calc(1.2 * var(--u));
}
.card.with-pad #card-title {
  font-size: calc(5 * var(--u));
}
.card.with-pad #card-text {
  font-size: calc(3.9 * var(--u));
  min-height: 2.6em;
}
.card.with-pad .btn.sm {
  --h: calc(8.6 * var(--u));
  font-size: calc(3.8 * var(--u));
}
.card.with-pad .card-btns:not(:has(.btn:not([hidden]))) {
  display: none;
}
.hinting .key {
  --h: calc(11.6 * var(--u));
}
.hinting .key b {
  font-size: calc(6.4 * var(--u));
}
.hinting .key small {
  display: none;
}
.card-btns {
  flex: none;
  margin-top: calc(0.8 * var(--u));
  display: flex;
  justify-content: flex-end;
  gap: calc(1.4 * var(--u)) calc(2 * var(--u));
}

/* ---- lying down: board on the left, everything else beside it ---- */
@media (orientation: landscape) {
  .top {
    width: calc(100% - 7 * var(--u));
  }
  #game .ib {
    --h: calc(9.6 * var(--u));
  }
  .top > .ib:first-child {
    margin-right: calc(11.8 * var(--u));
  }
  .pill {
    min-width: calc(48 * var(--u));
    height: calc(8.6 * var(--u));
    font-size: calc(4.1 * var(--u));
  }
  /* Board and side column share one row: the row sits in the middle of the free height and both stand on its
     bottom line. A taller column (lesson card + number pad) grows upward, beside the axolotl, never off the screen. */
  .stage {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-content: center;
    align-items: end;
    column-gap: calc(3 * var(--u));
    padding-top: calc(var(--peek) * 0.9);
    padding-bottom: calc(3 * var(--u));
  }
  .board-wrap {
    margin-top: 0;
  }
  .deck {
    width: calc(54 * var(--u));
    height: auto;
    min-height: var(--b);
    justify-content: flex-start;
  }
  .info {
    height: calc(7 * var(--u));
  }
  #g-mistakes {
    --nine: plate;
    --slice: 36 48 40 48;
    --edge: 2.2;
    flex: 1;
    justify-content: center;
    font-size: calc(4.2 * var(--u));
    color: #fff;
    background-color: #1a3f8a;
    background-blend-mode: screen;
    border-radius: calc(2.4 * var(--u));
  }
  #g-mistakes {
    box-shadow: inset 0 0 0 calc(0.3 * var(--u)) #7b86e6;
  }
  #g-mode:empty {
    display: none;
  }
  .deck::before {
    display: none;
  }
  .deck {
    gap: calc(3 * var(--u));
  }
  #g-mode:not(:empty) {
    margin-left: calc(1.6 * var(--u));
  }
  .hinting .key {
    --h: calc(8.2 * var(--u));
  }
  .hinting .key b {
    font-size: calc(5.4 * var(--u));
  }
  .card.with-pad #card-text {
    font-size: calc(3.4 * var(--u));
  }
  .card.with-pad {
    padding: calc(2 * var(--u)) calc(3.4 * var(--u));
  }
  .card.with-pad .btn.sm {
    --h: calc(7.8 * var(--u));
    font-size: calc(3.4 * var(--u));
  }
  .card {
    min-height: calc(30 * var(--u));
  }
  .card-btns .btn.sm {
    --h: calc(9 * var(--u));
    font-size: calc(3.7 * var(--u));
  }
  .pad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: calc(1.6 * var(--u));
  }
  .key {
    --h: calc((var(--b) - 30 * var(--u)) / 3);
  }
  .key b {
    font-size: calc(6.2 * var(--u));
  }
  .tool {
    --h: calc(11.6 * var(--u));
    font-size: calc(2.7 * var(--u));
  }
  .tool .ic {
    width: calc(5.2 * var(--u));
    height: calc(5.2 * var(--u));
  }
  .tool em {
    top: calc(-1.6 * var(--u));
    right: calc(-1.2 * var(--u));
  }
  #card-text {
    font-size: calc(3.6 * var(--u));
  }
  #card-title {
    font-size: calc(3.7 * var(--u));
    white-space: nowrap;
  }
  #card-count {
    font-size: calc(3.4 * var(--u));
  }
}

/* a phone lying down (see css/01-base.css): wider side column, bigger labels */
@media (orientation: landscape) and (max-height: 520px) {
  #game {
    padding-top: calc(2 * var(--u) + var(--sat));
  }
  .stage {
    padding-top: calc(var(--peek) * 0.8);
    padding-bottom: calc(1.5 * var(--u));
  }
  .deck {
    width: calc(68 * var(--u));
  }
  .tool {
    font-size: calc(3.3 * var(--u));
  }
  .key b {
    font-size: calc(7.6 * var(--u));
  }
  #card-text {
    font-size: calc(4 * var(--u));
  }
}
/* End of css/04-game-deck.css (complete file). */
