@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600;700;800&family=VT323&display=swap");

:root {
  --ink: #171717;
  --paper: #fff7d6;
  --panel: #f9d85f;
  --accent: #39c6f0;
  --danger: #e64b3c;
  --win: #26a65b;
  --shadow: #171717;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "VT323", monospace;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(45deg, rgba(23, 23, 23, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 23, 23, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(23, 23, 23, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(23, 23, 23, 0.06) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.container {
  min-height: 100vh;
  width: 100%;
  max-width: 1040px;
  margin: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

.hero {
  width: min(100%, 760px);
  padding: 24px;
  background: var(--panel);
  border: 8px solid var(--ink);
  box-shadow: 12px 12px 0 var(--shadow);
}

.eyebrow {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  text-transform: uppercase;
}

.container h1 {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.scoreboard div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 5px solid var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
}

.scoreboard span,
.scoreboard strong,
.status,
.button {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.images {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 18px;
}

.choice {
  min-height: 230px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #ffffff;
  border: 8px solid var(--ink);
  box-shadow: 9px 9px 0 var(--shadow);
  cursor: pointer;
  image-rendering: pixelated;
  transition: transform 120ms steps(2), box-shadow 120ms steps(2), background-color 120ms steps(2);
}

.choice:hover,
.choice:focus-visible {
  transform: translate(-4px, -4px);
  box-shadow: 13px 13px 0 var(--shadow);
  outline: none;
}

.choice.is-selected {
  background: var(--accent);
  transform: translate(4px, 4px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.choice:disabled {
  cursor: wait;
}

img {
  width: min(100%, 170px);
  height: 170px;
  object-fit: contain;
  padding: 0.25rem;
  image-rendering: pixelated;
}

.container .button {
  min-width: 190px;
  background-color: #ffffff;
  color: var(--ink);
  border: 8px solid var(--ink);
  padding: 14px 30px;
  text-transform: uppercase;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 8px 8px 0 var(--shadow);
  transition: transform 120ms steps(2), box-shadow 120ms steps(2), background-color 120ms steps(2);
}

.container .button:hover:not(:disabled),
.container .button:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 11px 11px 0 var(--shadow);
  outline: none;
}

.container .button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: 4px 4px 0 var(--shadow);
}

.display {
  width: min(100%, 780px);
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  background: #ffffff;
  border: 8px solid var(--ink);
  box-shadow: 10px 10px 0 var(--shadow);
}

.result {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  text-transform: uppercase;
}

.hand-display {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hand-display span {
  font-size: 1.8rem;
  text-transform: uppercase;
}

.is-win {
  color: var(--win);
}

.is-lose {
  color: var(--danger);
}

.is-draw {
  color: var(--ink);
}

.is-shuffling .comDisplay img {
  animation: pixel-hop 120ms steps(2) infinite;
}

@keyframes pixel-hop {
  50% {
    transform: translateY(-8px);
  }
}

@media screen and (max-width: 768px) {
  .container {
    justify-content: flex-start;
    padding: 18px;
    gap: 18px;
  }

  .hero {
    padding: 18px;
    border-width: 6px;
    box-shadow: 7px 7px 0 var(--shadow);
  }

  .scoreboard {
    grid-template-columns: 1fr 1fr;
  }

  .images {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .choice {
    min-height: 140px;
    border-width: 6px;
    box-shadow: 6px 6px 0 var(--shadow);
  }

  img {
    width: 112px;
    height: 112px;
  }

  .container .button {
    width: 100%;
    padding: 12px 18px;
    border-width: 6px;
    box-shadow: 6px 6px 0 var(--shadow);
  }

  .display {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border-width: 6px;
    box-shadow: 7px 7px 0 var(--shadow);
  }

  .hand-display {
    min-height: 150px;
  }
}
