:root {
  --bg: #3e975c;
  --bg-light: #e8ecd6;
  --text: #0b1313;
  --text-light: azure;
  --accent: rgb(1, 1, 36);
  --human: rgb(187, 48, 48);
  --win: #27ae60;
  --lose: #e74c3c;
  --draw: #f39c12;
  --radius: 12px;
  --transition: 0.2s ease;
}

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

html, body {
  width: 100%;
  height: 100%;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

.container {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: var(--bg);
  color: var(--text-light);
}

/* Top row */
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.user-display,
.computer-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.user-display .choice-img,
.computer-choice .choice-img {
  width: 60px;
  height: 60px;
}

.user-display .choice-img[src=""],
.user-display .choice-img:not([src]),
.computer-choice .choice-img[src=""],
.computer-choice .choice-img:not([src]) {
  opacity: 0;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.choice-label {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.7;
}

.score-board {
  text-align: center;
}

.score-display {
  font-size: 48px;
  font-weight: bold;
}

.reset-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 22px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.reset-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

/* Result row */
.result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: var(--bg-light);
  color: var(--text);
  margin: 0 24px;
  border-radius: var(--radius);
  padding: 24px;
}

.result-img {
  width: 100px;
  height: 100px;
  background: #222;
  border-radius: 20%;
  object-fit: contain;
  padding: 12px;
  transition: opacity var(--transition);
}

.result-img[src=""],
.result-img:not([src]) {
  opacity: 0;
}

.result-text {
  font-size: 28px;
  font-weight: bold;
  min-width: 160px;
  text-align: center;
}

/* Bottom row */
.bottom-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}

.choice-btn {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 5px solid var(--human);
  background: white;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.choice-btn:active {
  transform: scale(0.95);
}

.choice-btn img {
  width: 70px;
  height: 70px;
  pointer-events: none;
  background: #222;
  border-radius: 50%;
  padding: 8px;
}

.choice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.phase-choosing .choice-btn:not(:disabled) {
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* History row */
.history-row {
  padding: 0 24px 16px;
  max-height: 100px;
  overflow-y: auto;
}

.round-history {
  list-style: none;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.round-history li {
  font-size: 13px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  opacity: 1;
  transition: opacity 0.5s;
}

.round-history li.fade {
  opacity: 0.4;
}

/* Win / lose / draw colors on result text */
.result-win { color: var(--win); }
.result-lose { color: var(--lose); }
.result-draw { color: var(--draw); }

/* Responsive */
@media (max-width: 600px) {
  .result-row { flex-direction: column; gap: 12px; padding: 16px; }
  .result-img { width: 80px; height: 80px; }
  .result-text { font-size: 22px; min-width: auto; }
  .choice-btn { width: 80px; height: 80px; }
  .choice-btn img { width: 50px; height: 50px; }
  .score-display { font-size: 36px; }
}
