/* Table geometry only. Chrome comes from GOV.UK Frontend.
   Source Sans 3 stands in for GDS Transport, which is licensed for gov.uk only. */

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/source-sans-3-latin-700-normal.woff2") format("woff2");
}

:root {
  --govuk-brand-colour: #0f7a52;
  --govuk-link-colour: #0b5c3e;
  --govuk-link-hover-colour: #083d29;
  --govuk-link-visited-colour: #0b5c3e;
  --govuk-link-active-colour: #0b0c0c;
  --govuk-surface-background-colour: #f3f8f6;
  --govuk-surface-border-colour: #87bca8;
}

html {
  font-family: "Source Sans 3", arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: #ffffff;
}

body.govuk-template__body {
  min-height: 100vh;
  background-color: #ffffff;
}

.govuk-width-container {
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

@media (min-width: 40.0625em) {
  .govuk-width-container {
    margin-left: auto;
    margin-right: auto;
    padding-left: 30px;
    padding-right: 30px;
  }
}

main.govuk-main-wrapper {
  padding-top: 20px;
  padding-bottom: 30px;
}

.govuk-generic-header {
  background: var(--govuk-brand-colour, #0f7a52);
}

.govuk-generic-header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.govuk-generic-header__logo {
  display: flex;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
}

.govuk-generic-header__homepage-link {
  display: inline-flex;
  align-items: center;
  font-size: 0;
  line-height: 0;
}

.govuk-generic-header__homepage-link img {
  display: block;
  height: 28px;
  width: auto;
  vertical-align: middle;
  filter: brightness(0) invert(1);
}

.govuk-generic-header__homepage-link:focus img {
  filter: none;
}

.govuk-generic-header .legend {
  flex: 0 1 auto;
  margin: 0 0 0 auto;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.25;
  white-space: nowrap;
  text-align: right;
}

html[lang="bn"] {
  font-family: "Noto Sans Bengali", "Bangla Sangam MN", "Nirmala UI", "Kohinoor Bangla", "Source Sans 3", arial, sans-serif;
}

.mast-end {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin: 10px 0 10px auto;
}

.govuk-service-navigation .govuk-language-navigation {
  margin: 0;
}

.govuk-service-navigation .govuk-language-navigation__list {
  row-gap: 0;
}

.site-footer {
  padding-bottom: 24px;
}

.site-footer__fineprint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #505a5f;
}

.site-footer__fineprint .govuk-link {
  color: #505a5f;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22.5rem;
  gap: 30px;
  align-items: start;
}

.layout.rules-mode {
  grid-template-columns: minmax(0, 42rem);
}

.layout.rules-mode #pad {
  display: none;
}

.felt {
  position: relative;
  min-height: 0;
}

.baize {
  position: relative;
  height: calc(100vh - 168px);
  min-height: 640px;
  overflow: hidden;
  background-color: #e6eeea;
  background-image: linear-gradient(rgba(230, 238, 234, 0.92), rgba(230, 238, 234, 0.92)), url("../assets/tiles/Felt_Green.png");
  border: 1px solid #b1b4b6;
}

.rail-felt {
  position: absolute;
  z-index: 5;
  top: 15px;
  left: 15px;
  right: 15px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
}

.ribbon {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.25;
  color: #0b0c0c;
}

.chaka {
  min-width: 4.5rem;
  background: #ffffff;
  color: #0b0c0c;
  border: 1px solid #0b0c0c;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
}

.chaka span {
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 700;
}

.chaka .dots {
  display: grid;
  grid-template-columns: 8px 8px;
  gap: 5px 7px;
  margin: 0;
  padding: 0;
}

.chaka .dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #0b0c0c;
}

.chaka .dots i.red {
  background: #ca3535;
  box-shadow: none;
}

.chaka .dots i.black {
  background: #0b0c0c;
  box-shadow: none;
}

.seat {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.seat.north {
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column-reverse;
}

.seat.south {
  bottom: 10px;
  left: 50%;
  width: min(720px, 94%);
  transform: translateX(-50%);
}

.seat.west {
  left: 15px;
  top: 54%;
  transform: translateY(-50%);
}

.seat.east {
  right: 15px;
  top: 54%;
  transform: translateY(-50%);
}

.seat-name {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 2px 8px;
  font-size: 1rem;
  line-height: 1.25;
  color: #ffffff;
  background: #0b0c0c;
}

.seat-name em {
  font-style: normal;
  font-weight: 700;
}

.fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.seat.south .fan .card + .card {
  margin-left: -22px;
}

.seat.north .fan .card + .card {
  margin-left: -46px;
}

.seat.west .fan,
.seat.east .fan {
  flex-direction: column;
  align-items: center;
}

.seat.west .card + .card,
.seat.east .card + .card {
  margin-top: -74px;
}

.trick {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 52%;
  width: 250px;
  height: 250px;
  transform: translate(-50%, -50%);
}

.trick-slot {
  position: absolute;
}

.trick-slot.north {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.trick-slot.south {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.trick-slot.west {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.trick-slot.east {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.trick-slot .card {
  width: 71px;
  height: 96px;
}

.trump-mark {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 48%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  line-height: 1;
  color: rgba(11, 12, 12, 0.12);
  pointer-events: none;
}

.buried {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.buried .card {
  width: 71px;
  height: 96px;
}

.buried em {
  font-style: normal;
  font-size: 1rem;
  line-height: 1.25;
  color: #ffffff;
  background: #0b0c0c;
  padding: 2px 8px;
}

.buried.for-S {
  left: 4%;
  bottom: 118px;
}

.buried.for-N {
  left: 14%;
  top: 160px;
}

.buried.for-E {
  right: 92px;
  top: 30%;
}

.buried.for-W {
  left: 92px;
  top: 30%;
}

button.card,
.card {
  position: relative;
  isolation: isolate;
  display: inline-block;
  width: 71px;
  height: 96px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  line-height: 0;
  box-shadow: none;
  cursor: default;
}

.card img {
  display: block;
  width: 71px;
  height: 96px;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.card .card-shadow {
  position: absolute;
  z-index: 0;
  top: 2px;
  left: 2px;
  filter: brightness(0);
  opacity: 0.55;
}

.card .card-face {
  position: relative;
  z-index: 1;
}

.card.trump {
  outline: 3px solid #0b0c0c;
}

.card.dim {
  background: #fff;
}

.card.dim::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.card.playable {
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .seat.south .card.playable:hover {
    transform: translateY(-8px);
    z-index: 3;
  }
}

.seat.south .card.playable:active {
  transform: translateY(-10px);
  z-index: 5;
}

.trick-slot .card {
  animation: lay 220ms ease;
}

@keyframes lay {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pad .govuk-heading-l {
  margin-bottom: 15px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-start;
  margin: 0 0 20px;
}

.choices .govuk-button {
  margin-bottom: 0;
}

.choices .choice {
  width: 100%;
  text-align: left;
}

.choices .choice.right,
.choices .choice.right:hover {
  background-color: #cfe4dc;
  box-shadow: 0 2px 0 #0f7a52;
  color: #0b0c0c;
}

.choices .choice.wrong,
.choices .choice.wrong:hover {
  background-color: #f4d7d7;
  box-shadow: 0 2px 0 #ca3535;
  color: #0b0c0c;
}

.choices .govuk-body {
  flex: 1 0 100%;
  margin-bottom: 0;
}

.pad .govuk-checkboxes {
  margin-bottom: 20px;
}

.log {
  margin-bottom: 0;
}

.felt.paper {
  height: auto;
}

.rules .govuk-heading-l {
  margin-bottom: 20px;
}

.rules-fold {
  margin-top: 10px;
  border-bottom: 1px solid #b1b4b6;
}

.rules-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 0;
}

.rules-fold > summary::-webkit-details-marker {
  display: none;
}

.rules-fold > summary .govuk-heading-m {
  display: inline;
  margin: 0;
  padding-right: 1.5rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%230b0c0c' d='M8 11.5L2.5 6l1.4-1.4L8 8.7l4.1-4.1L13.5 6z'/%3E%3C/svg%3E")
    right 0.35em no-repeat;
}

.rules-fold[open] > summary .govuk-heading-m {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%230b0c0c' d='M8 4.5L13.5 10l-1.4 1.4L8 7.3l-4.1 4.1L2.5 10z'/%3E%3C/svg%3E");
}

.rules-fold__body {
  padding: 0 0 20px;
}

.rules-cite {
  font-size: 0.85em;
  margin-left: 0.15em;
}

.rules-refs__title {
  margin-top: 0;
  padding-top: 0;
}

.rules-refs {
  margin-top: 10px;
  color: var(--govuk-secondary-text-colour, #484949);
}

.rules-refs li {
  margin-bottom: 10px;
}

.rules-more {
  margin-top: 10px;
  margin-bottom: 20px;
}

.card:focus-visible {
  outline: 3px solid #ffdd00;
  outline-offset: 0;
  z-index: 4;
}

@media (max-width: 40.0525em) {
  /* Logo left, points top-right — one green row. Language alone beside Menu. */
  .govuk-generic-header__container {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .govuk-generic-header__logo {
    flex: 0 0 auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .govuk-generic-header .legend {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
  }

  .govuk-service-navigation__inlining-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .govuk-service-navigation__container {
    flex: 1 1 auto;
    min-width: 0;
  }

  .mast-end {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
  }

  /* Only the other language — one short switch, not English | বাংলা. */
  .govuk-language-navigation__list-item:has(.govuk-language-navigation__text) {
    display: none;
  }

  .govuk-language-navigation__list-item {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }

  /* GOV.UK puts the | on :after of every non-last item; with the
     current language hidden, English is still not :last-child. */
  .govuk-language-navigation__list-item:not(:last-child):after {
    display: none;
  }

  .govuk-service-navigation__wrapper {
    width: 100%;
  }

  .govuk-service-navigation__toggle {
    display: flex;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px 8px 0;
    justify-content: flex-start;
  }

  .govuk-service-navigation__item {
    margin-top: 0;
    margin-bottom: 0;
  }

  .govuk-service-navigation__link {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 8px 0;
  }

  .govuk-language-navigation__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
  }

  .site-footer {
    padding-bottom: 20px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .baize {
    height: 560px;
    min-height: 560px;
  }

  .rail-felt {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }

  .ribbon {
    flex: 1 0 100%;
    order: -1;
    margin-bottom: 8px;
  }

  button.card,
  .card,
  .card img,
  .trick-slot .card,
  .buried .card {
    width: 52px;
    height: 72px;
  }

  .seat.north {
    top: 118px;
    flex-direction: column-reverse;
  }

  .seat.west,
  .seat.east {
    top: 56%;
  }

  .seat.west .card + .card,
  .seat.east .card + .card {
    margin-top: -56px;
  }

  .seat.south {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-inline: 2px;
  }

  .seat.south .fan {
    --hand-card: 52px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* Fill the seat, and overlap only when eight cards would not fit as separate targets. */
  .seat.south .fan .card + .card {
    margin-left: min(4px, calc((100% - var(--hand-count, 8) * var(--hand-card)) / (var(--hand-count, 8) - 1)));
  }

  .seat.south .fan .card {
    flex: 0 0 auto;
    touch-action: manipulation;
  }

  .seat.north .fan .card + .card {
    margin-left: -34px;
  }

  .buried.for-S {
    bottom: 96px;
  }

  .trick {
    width: 180px;
    height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trick-slot .card {
    animation: none;
  }

  .seat.south .card.playable:hover,
  .seat.south .card.playable:active {
    transform: none;
  }
}

@media (min-width: 40.0625em) {
  .govuk-service-navigation__container .govuk-service-navigation__wrapper {
    flex-grow: 0;
  }
}
