* {
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0b1020, #1a2f66, #3b1b6a, #0f2f55);
  background-size: 250% 250%;
  animation: bgShift 24s linear infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  color: white;
}

.hidden {
  display: none !important;
}

#auth,
#register,
#rules,
#game {
  width: min(520px, 100%);
  background: rgba(0, 0, 0, 0.62);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

h2, h3, p {
  margin-top: 0;
}

input,
button {
  display: block;
  width: 100%;
  margin: 10px auto;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

button {
  cursor: pointer;
}

button.secondary {
  background: #1b2b4b;
  color: white;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.player,
.ai {
  display: flex;
  gap: 32px;
}

img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s;
  border-radius: 10px;
  background: rgba(10, 26, 56, 0.5);
}

img:hover {
  transform: translateY(-6px);
}

img.selected {
  outline: 3px solid #82d1ff;
  outline-offset: 2px;
}

.controls {
  display: flex;
  gap: 10px;
}

.controls button {
  width: 120px;
  margin: 0;
}

.hint {
  text-align: center;
  opacity: 0.9;
  margin: 14px 0 0;
  font-size: 0.95rem;
}

#end {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

#end img {
  width: min(70vw, 480px);
  max-height: 55vh;
}


@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.status {
  text-align: center;
  margin: 0 0 10px;
  font-weight: 700;
  color: #9de1ff;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


#end button {
  width: auto;
  min-width: 180px;
  padding: 10px 18px;
  margin: 0;
}


body[data-bg="neon"] {
  background: linear-gradient(135deg, #0b1020, #1a2f66, #3b1b6a, #0f2f55);
  background-size: 250% 250%;
}

body[data-bg="sunset"] {
  background: linear-gradient(135deg, #512b58, #ff7f50, #ffb347, #ff5f6d);
  background-size: 250% 250%;
}

body[data-bg="ocean"] {
  background: linear-gradient(135deg, #0b3c5d, #328cc1, #d9f0ff, #145da0);
  background-size: 250% 250%;
}

body[data-bg="forest"] {
  background: linear-gradient(135deg, #1f4037, #99f2c8, #2c7744, #0b3d2e);
  background-size: 250% 250%;
}

body[data-bg="space"] {
  background: linear-gradient(135deg, #000000, #1a0933, #3a0ca3, #4361ee);
  background-size: 250% 250%;
}

select {
  display: block;
  width: 100%;
  margin: 8px auto 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: #17203a;
}

.label {
  display: block;
  margin-top: 10px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.rules-card ul {
  padding-left: 20px;
  line-height: 1.5;
}


.meta {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

#scoreboard {
  margin-bottom: 8px;
}


.panel {
  width: min(520px, 100%);
}


@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}


.trash-talk {
  text-align: center;
  margin: 0 0 8px;
  font-weight: 600;
  color: #ffd166;
  min-height: 24px;
}
