:root {
  --primary: var(--primary-400);

  --primary-100: #e5ffe5;
  --primary-200: #b8ffb8;
  --primary-300: #5cff5c;
  --primary-400: #00ff00;
  --primary-500: #00d600;
  --primary-600: #00ad00;
  --primary-700: #008500;
  --primary-800: #005c00;
  --primary-900: #003300;
  --primary-950: #000a00;

  --white: #ffffff;
  --black: #000000;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--primary-950);
  display: grid;
  place-content: center;
  min-height: 100svh;
  overflow: hidden;
}

#matrix-rain {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.fingerprint-scanner {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fingerprint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.5rem;
  border: none;
  color: var(--white);
  background: none;
}

.pulsing {
  animation: pulse 1s infinite;
}

/* animation pulsing from var(--white) to var(--primary) */
@keyframes pulse {
  0% {
    color: var(--white);
  }
  50% {
    color: var(--primary);
  }
  100% {
    color: var(--white);
  }
}

.scanner {
  --_size: 20px;
  --_opacity: 0.5;
  position: absolute;
  left: 0;
  top: calc(var(--_size) * -1);
  border-top: var(--_size) solid rgba(51, 255, 0, var(--_opacity));
  width: 100%;
  height: 0;
  z-index: 10;
}

.result {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity 0.3s ease;
}

#reset {
  background: var(--primary-200);
  color: var(--primary-900);
  border: none;
  padding: 10px 35px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.5rem;
}

/* Playing Card Styles */
.playing-card {
  --_border-radius: 10px;
  width: 250px;
  aspect-ratio: 10 / 14;
  background: var(--primary-950);
  border-radius: var(--_border-radius);
  padding: 10px;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-family: sans-serif;
  color: var(--primary);
  max-width: 300px;
  border: 1px solid var(--primary);
}

.playing-card.red {
  /* --_color: #d40000; */
  --_color: var(--primary);
}

.playing-card.black {
  /* --_color: #000000; */
  --_color: var(--primary);
}

.playing-card .value {
  letter-spacing: -6px;
}

[data-card='1'] .playing-card[data-position='1'],
[data-card='2'] .playing-card[data-position='2'],
[data-card='3'] .playing-card[data-position='3'],
[data-card='4'] .playing-card[data-position='4'],
[data-card='5'] .playing-card[data-position='5'],
[data-card='6'] .playing-card[data-position='6'] {
  display: block;
}

.corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 40px;
}

.corner .suit {
  line-height: 1;
  font-size: 20px;
  max-width: 20px;
}

.top-left {
  top: 10px;
  left: 10px;
}

.bottom-right {
  bottom: 10px;
  right: 10px;
  transform: rotate(180deg);
}

.pips {
  position: absolute;
  inset: 32px 48px;
  display: grid;
  grid-template-rows: repeat(12, 1fr);
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
}

.pip {
  font-size: 42px;
  grid-column: var(--col, auto);
  grid-row: var(--row, auto);
  line-height: 1;
  transform: var(--transform, none);
}

/* 1 - Ace */
.playing-card[data-value='1'] .pip:nth-child(1) {
  --col: 2;
  --row: 6;
}

/* 2 */
.playing-card[data-value='2'] .pip:nth-child(1) {
  --col: 2;
  --row: 1;
}
.playing-card[data-value='2'] .pip:nth-child(2) {
  --col: 2;
  --row: 12;
  --transform: rotate(180deg);
}

/* 3 */
.playing-card[data-value='3'] .pip:nth-child(1) {
  --col: 2;
  --row: 1;
}
.playing-card[data-value='3'] .pip:nth-child(2) {
  --col: 2;
  --row: 6;
}
.playing-card[data-value='3'] .pip:nth-child(3) {
  --col: 2;
  --row: 12;
  --transform: rotate(180deg);
}

/* 4 */
.playing-card[data-value='4'] .pip:nth-child(1) {
  --col: 1;
  --row: 1;
}
.playing-card[data-value='4'] .pip:nth-child(2) {
  --col: 3;
  --row: 1;
}
.playing-card[data-value='4'] .pip:nth-child(3) {
  --col: 1;
  --row: 12;
  --transform: rotate(180deg);
}
.playing-card[data-value='4'] .pip:nth-child(4) {
  --col: 3;
  --row: 12;
  --transform: rotate(180deg);
}

/* 5 */
.playing-card[data-value='5'] .pip:nth-child(1) {
  --col: 1;
  --row: 1;
}
.playing-card[data-value='5'] .pip:nth-child(2) {
  --col: 3;
  --row: 1;
}
.playing-card[data-value='5'] .pip:nth-child(3) {
  --col: 2;
  --row: 6;
}
.playing-card[data-value='5'] .pip:nth-child(4) {
  --col: 1;
  --row: 12;
  --transform: rotate(180deg);
}
.playing-card[data-value='5'] .pip:nth-child(5) {
  --col: 3;
  --row: 12;
  --transform: rotate(180deg);
}

/* 6 */
.playing-card[data-value='6'] .pip:nth-child(1) {
  --col: 1;
  --row: 1;
}
.playing-card[data-value='6'] .pip:nth-child(2) {
  --col: 3;
  --row: 1;
}
.playing-card[data-value='6'] .pip:nth-child(3) {
  --col: 1;
  --row: 6;
}
.playing-card[data-value='6'] .pip:nth-child(4) {
  --col: 3;
  --row: 6;
}
.playing-card[data-value='6'] .pip:nth-child(5) {
  --col: 1;
  --row: 12;
  --transform: rotate(180deg);
}
.playing-card[data-value='6'] .pip:nth-child(6) {
  --col: 3;
  --row: 12;
  --transform: rotate(180deg);
}

/* 7 */
.playing-card[data-value='7'] .pip:nth-child(1) {
  --col: 1;
  --row: 1;
}
.playing-card[data-value='7'] .pip:nth-child(2) {
  --col: 3;
  --row: 1;
}
.playing-card[data-value='7'] .pip:nth-child(3) {
  --col: 2;
  --row: 2 / 4;
}
.playing-card[data-value='7'] .pip:nth-child(4) {
  --col: 1;
  --row: 6;
}
.playing-card[data-value='7'] .pip:nth-child(5) {
  --col: 3;
  --row: 6;
}
.playing-card[data-value='7'] .pip:nth-child(6) {
  --col: 1;
  --row: 12;
  --transform: rotate(180deg);
}
.playing-card[data-value='7'] .pip:nth-child(7) {
  --col: 3;
  --row: 12;
  --transform: rotate(180deg);
}

/* 8 */
.playing-card[data-value='8'] .pip:nth-child(1) {
  --col: 1;
  --row: 1;
}
.playing-card[data-value='8'] .pip:nth-child(2) {
  --col: 3;
  --row: 1;
}
.playing-card[data-value='8'] .pip:nth-child(3) {
  --col: 1;
  --row: 4;
}
.playing-card[data-value='8'] .pip:nth-child(4) {
  --col: 3;
  --row: 4;
}
.playing-card[data-value='8'] .pip:nth-child(5) {
  --col: 1;
  --row: 8;
}
.playing-card[data-value='8'] .pip:nth-child(6) {
  --col: 3;
  --row: 8;
  --transform: rotate(180deg);
}
.playing-card[data-value='8'] .pip:nth-child(7) {
  --col: 1;
  --row: 12;
  --transform: rotate(180deg);
}
.playing-card[data-value='8'] .pip:nth-child(8) {
  --col: 3;
  --row: 12;
  --transform: rotate(180deg);
}

/* 9 */
.playing-card[data-value='9'] .pip:nth-child(1) {
  --col: 1;
  --row: 1;
}
.playing-card[data-value='9'] .pip:nth-child(2) {
  --col: 3;
  --row: 1;
}
.playing-card[data-value='9'] .pip:nth-child(3) {
  --col: 1;
  --row: 6;
}
.playing-card[data-value='9'] .pip:nth-child(4) {
  --col: 3;
  --row: 6;
}
.playing-card[data-value='9'] .pip:nth-child(5) {
  --col: 2;
  --row: 3 / 9;
}
.playing-card[data-value='9'] .pip:nth-child(6) {
  --col: 1;
  --row: 8;
  --transform: rotate(180deg);
}
.playing-card[data-value='9'] .pip:nth-child(7) {
  --col: 2;
  --row: 8;
  --transform: rotate(180deg);
}
.playing-card[data-value='9'] .pip:nth-child(8) {
  --col: 1;
  --row: 12;
  --transform: rotate(180deg);
}
.playing-card[data-value='9'] .pip:nth-child(9) {
  --col: 3;
  --row: 12;
  --transform: rotate(180deg);
}

/* 10 */
.playing-card[data-value='10'] .pip:nth-child(1) {
  --col: 1;
  --row: 1;
}
.playing-card[data-value='10'] .pip:nth-child(2) {
  --col: 3;
  --row: 1;
}
.playing-card[data-value='10'] .pip:nth-child(3) {
  --col: 2;
  --row: 2 / 4;
}
.playing-card[data-value='10'] .pip:nth-child(4) {
  --col: 1;
  --row: 4;
}
.playing-card[data-value='10'] .pip:nth-child(5) {
  --col: 3;
  --row: 4;
}
.playing-card[data-value='10'] .pip:nth-child(6) {
  --col: 1;
  --row: 8;
}
.playing-card[data-value='10'] .pip:nth-child(7) {
  --col: 3;
  --row: 8;
}
.playing-card[data-value='10'] .pip:nth-child(8) {
  --col: 2;
  --row: 9 / 11;
}
.playing-card[data-value='10'] .pip:nth-child(9) {
  --col: 1;
  --row: 12;
}
.playing-card[data-value='10'] .pip:nth-child(10) {
  --col: 3;
  --row: 12;
}

.playing-card[data-value='11'] .pips,
.playing-card[data-value='12'] .pips,
.playing-card[data-value='13'] .pips {
  border: 1px solid var(--_color);
  inset: 48px;
  border-radius: 5px;
}

.playing-card[data-value='11'] .pip:nth-child(1),
.playing-card[data-value='12'] .pip:nth-child(1),
.playing-card[data-value='13'] .pip:nth-child(1) {
  --col: 2;
  --row: 6;
  font-size: 80px;
}

/*
 * Utilities Classes
 */

/* Screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #eee;
  clip: auto !important;
  clip-path: none;
  color: #444;
  display: block;
  font-size: 1em;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}
