:root {
  --bg: #070b14;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-soft: rgba(31, 41, 55, 0.78);
  --border: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #a7b2c4;
  --accent: #facc15;
  --accent-2: #38bdf8;
  --win: #22c55e;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 16% 20%, rgba(250, 204, 21, 0.16), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(56, 189, 248, 0.2), transparent 30%),
    linear-gradient(145deg, #070b14 0%, #121826 54%, #0f172a 100%);
  color: var(--text);
}

#juego {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 24px;
  align-items: stretch;
}

.game-header,
.pantalla,
.buttons {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.game-header {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5.8vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro {
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.pantalla {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(17, 24, 39, 0.76)),
    var(--panel);
}

.pantalla::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  pointer-events: none;
}

.buttons {
  grid-column: 1 / -1;
  min-height: 176px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.btn {
  position: relative;
  min-height: 144px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--panel-soft);
  background-size: contain;
  background-position: center 18px;
  background-repeat: no-repeat;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(250, 204, 21, 0.72);
  background-color: rgba(30, 41, 59, 0.94);
  outline: none;
}

.button1 {
  background-image: url(stone.png);
}

.button2 {
  background-image: url(paper.png);
}

.button3 {
  background-image: url(scissors.png);
}

.label,
.key {
  position: absolute;
  z-index: 2;
}

.label {
  left: 16px;
  bottom: 14px;
  font-weight: 800;
}

.key {
  right: 14px;
  top: 12px;
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.58);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
}

.n1 {
  background-image: url(1.png);
}

.n2 {
  background-image: url(2.png);
}

.n3 {
  background-image: url(3.png);
}

.number {
  width: min(360px, 70%);
  aspect-ratio: 1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  transform: scale(0);
  opacity: 0;
  transition:
    opacity 450ms ease-out,
    transform 450ms ease-out;
}

.figuraCPU {
  width: min(360px, 70%);
  aspect-ratio: 1;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
}

.show {
  transform: scale(1);
  opacity: 1;
}

.mensaje {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 92px;
  min-height: 72px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.62);
  color: var(--text);
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 800;
}

.restart-btn {
  position: absolute;
  left: 50%;
  bottom: 24px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid rgba(250, 204, 21, 0.72);
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.14);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transform: translateX(-50%);
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.restart-btn:hover,
.restart-btn:focus-visible {
  background: rgba(250, 204, 21, 0.24);
  transform: translateX(-50%) translateY(-2px);
  outline: none;
}

.restart-btn[hidden] {
  display: none;
}

.sel {
  width: 54px;
  height: 54px;
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--win);
  color: #052e16;
  opacity: 0;
  font-size: 2rem;
  font-weight: 900;
  transform: scale(0.84);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.opacity {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 780px) {
  #juego {
    min-height: auto;
    padding: 24px 0;
    grid-template-columns: 1fr;
  }

  .pantalla {
    min-height: 430px;
  }
}

@media (max-width: 560px) {
  .buttons {
    grid-template-columns: 1fr;
  }

  .btn {
    min-height: 112px;
    background-position: center;
  }
}
