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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #000;
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 600px;
  text-align: center;
}

.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #fff;
}

.instructions {
  background: #1a1a1a;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
  text-align: left;
  border: 1px solid #333;
}

.instructions h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #4ecdc4;
  text-align: center;
}

.instructions p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 15px;
  color: #ccc;
}

.instructions ul {
  list-style: none;
  padding-left: 0;
}

.instructions li {
  padding: 10px 0;
  border-bottom: 1px solid #333;
  color: #ccc;
}

.instructions li:last-child {
  border-bottom: none;
}

.btn {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(78, 205, 196, 0.3);
}

.btn:active {
  transform: scale(0.98);
}

/* Game Screen */
.game-info {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.score-box {
  background: #1a1a1a;
  padding: 15px 25px;
  border-radius: 10px;
  border: 1px solid #333;
}

.score-box span {
  display: block;
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 5px;
}

.score-box strong {
  font-size: 1.5rem;
  color: #4ecdc4;
}

.battle-arena {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.player-side,
.computer-side {
  text-align: center;
}

.player-side h3,
.computer-side h3 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #888;
}

.choice-display {
  width: 120px;
  height: 120px;
  background: #1a1a1a;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 4rem;
  border: 3px solid #333;
  transition: all 0.3s ease;
}

.choice-display.winner {
  border-color: #4ecdc4;
  box-shadow: 0 0 30px rgba(78, 205, 196, 0.5);
}

.choice-display.loser {
  border-color: #ff6b6b;
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.vs {
  font-size: 2rem;
  color: #666;
  font-weight: bold;
}

.result-text {
  font-size: 1.5rem;
  margin-bottom: 20px;
  min-height: 40px;
  color: #fff;
}

.result-text.win {
  color: #4ecdc4;
}

.result-text.lose {
  color: #ff6b6b;
}

.result-text.draw {
  color: #ffd93d;
}

.choices {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.choice-btn {
  width: 100px;
  height: 100px;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 15px;
  font-size: 3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.choice-btn:hover {
  border-color: #4ecdc4;
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(78, 205, 196, 0.2);
}

.choice-btn:active {
  transform: translateY(0);
}

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

/* Animation */
@keyframes shake {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-20deg);
  }
  75% {
    transform: rotate(20deg);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.animating {
  animation: shake 0.3s ease infinite;
}

.bounce {
  animation: bounce 0.5s ease;
}

/* Letter Screen */
.letter-container {
  perspective: 1000px;
}

.envelope {
  width: 280px;
  height: 180px;
  background: linear-gradient(135deg, #f5e6d3, #e8d4b8);
  margin: 30px auto;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.5s ease;
}

.envelope::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(135deg, #e8d4b8, #d4c4a8);
  clip-path: polygon(0 0, 50% 60%, 100% 0);
  border-radius: 10px 10px 0 0;
}

.envelope::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: #c9302c;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  z-index: 10;
}

.letter-content {
  display: none;
  background: #fff;
  color: #333;
  padding: 30px;
  border-radius: 15px;
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: unfold 0.5s ease;
}

.letter-content.show {
  display: block;
}

@keyframes unfold {
  from {
    opacity: 0;
    transform: rotateX(-90deg);
  }
  to {
    opacity: 1;
    transform: rotateX(0);
  }
}

.letter-header {
  font-style: italic;
  color: #666;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.letter-body {
  line-height: 1.8;
  font-size: 1rem;
  color: #444;
  margin-bottom: 30px;
  text-align: justify;
}

.letter-footer {
  text-align: right;
  font-style: italic;
  color: #666;
  font-size: 0.95rem;
}

/* Lose Screen */
.lose-message {
  background: #1a1a1a;
  padding: 40px;
  border-radius: 15px;
  border: 1px solid #ff6b6b;
}

.lose-message h2 {
  color: #ff6b6b;
  margin-bottom: 20px;
}

.lose-message p {
  color: #ccc;
  margin-bottom: 30px;
  line-height: 1.6;
}

.btn-retry {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.btn-retry:hover {
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

/* Countdown */
.countdown {
  font-size: 4rem;
  color: #4ecdc4;
  margin: 50px 0;
  animation: pulse 0.5s ease infinite;
}

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

/* Progress Bar */
.progress-container {
  margin-top: 30px;
  background: #1a1a1a;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #333;
}

.progress-container span {
  display: block;
  margin-bottom: 10px;
  color: #888;
}

.progress-bar {
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4, #44a08d);
  transition: width 0.3s ease;
  border-radius: 5px;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .instructions {
    padding: 20px;
  }

  .choice-display {
    width: 100px;
    height: 100px;
    font-size: 3rem;
  }

  .choice-btn {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }

  .envelope {
    width: 240px;
    height: 160px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .instructions {
    padding: 15px;
  }

  .instructions h2 {
    font-size: 1.2rem;
  }

  .instructions p {
    font-size: 0.9rem;
  }

  .btn {
    padding: 12px 30px;
    font-size: 1rem;
  }

  .choice-display {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }

  .choice-btn {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .vs {
    font-size: 1.5rem;
  }

  .result-text {
    font-size: 1.2rem;
  }

  .letter-content {
    padding: 20px;
  }

  .letter-body {
    font-size: 0.9rem;
  }

  .envelope {
    width: 200px;
    height: 140px;
  }

  .score-box {
    padding: 10px 15px;
  }

  .score-box strong {
    font-size: 1.2rem;
  }
}

@media (max-width: 375px) {
  h1 {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }

  .instructions {
    padding: 12px;
  }

  .instructions h2 {
    font-size: 1.1rem;
  }

  .instructions p,
  .instructions li {
    font-size: 0.85rem;
  }

  .btn {
    padding: 10px 25px;
    font-size: 0.9rem;
  }

  .choice-display {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .choice-btn {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    gap: 10px;
  }

  .choices {
    gap: 10px;
  }

  .game-info {
    gap: 10px;
  }

  .score-box {
    padding: 8px 12px;
  }

  .score-box span {
    font-size: 0.8rem;
  }

  .score-box strong {
    font-size: 1rem;
  }

  .envelope {
    width: 180px;
    height: 120px;
  }

  .envelope::before {
    height: 70px;
  }

  .envelope::after {
    width: 45px;
    height: 45px;
  }

  .heart {
    font-size: 1.5rem;
  }

  .letter-content {
    padding: 15px;
  }

  .letter-body {
    font-size: 0.85rem;
    line-height: 1.7;
  }

  .letter-header,
  .letter-footer {
    font-size: 0.85rem;
  }

  .countdown {
    font-size: 3rem;
  }
}
