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

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #4fd661, #5a2ea6);
  font-family: 'DynaPuff', cursive;
}

.game-screen {
  width: 100%;
  max-width: 420px;
  text-align: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
}

.game-title {
  font-size: 80px;
  font-weight: 800;
  color: white;
  line-height: 1.1;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.primary-btn {
  width: 80%;
  background: linear-gradient(180deg, #ffd84d, #ffb700);
  border: none;
  padding: 22px;
  font-family: 'DynaPuff', cursive;
  font-size: 32px;
  font-weight: bold;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 8px 0 #d19a00, 0 12px 25px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.primary-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #d19a00, 0 8px 15px rgba(0, 0, 0, 0.3);
}

.screen {
  position: relative;
  min-height: 100vh;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.players-screen,
.pravila-screen,
.result-screen {
  justify-content: flex-start;
  padding: 100px 24px 140px;
}

.result-screen {
  justify-content: center;
  padding-top: 88px;
  padding-bottom: 156px;
  perspective: 1400px;
}

.hidden {
  display: none !important;
}

.restart-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgb(245, 245, 245);
  border: 2px solid rgb(9, 9, 9);
  color: rgb(12, 11, 11);
  padding: 10px 16px;
  border-radius: 12px;
  font-family: 'DynaPuff', cursive;
  font-size: 16px;
  cursor: pointer;
}

.restart-btn:hover,
.continue-btn:hover {
  background: rgba(255, 255, 255, 0.85);
}

.players-header {
  margin-bottom: 40px;
  text-align: center;
}

.screen-title {
  margin-bottom: 20px;
  font-size: 32px;
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-row input {
  flex: 1;
  padding: 14px 16px;
  font-size: 18px;
  font-family: 'DynaPuff', cursive;
  border-radius: 14px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  color: #010101;
}

.input-row input::placeholder {
  color: #999;
}

.players-list-wrapper {
  width: 60%;
  max-width: 320px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.player {
  width: 100%;
  text-align: center;
  background: transparent;
  color: white;
  padding: 10px 6px;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
}

#addPlayerBtn {
  background: linear-gradient(180deg, #ffd84d, #ffb700);
  border: none;
  padding: 14px 20px;
  border-radius: 14px;
  font-family: 'DynaPuff', cursive;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 5px 0 #d19a00;
}

#addPlayerBtn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #d19a00;
}

.continue-btn {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 80%);
  line-height: 1.2;
  text-align: center;
  background: rgb(245, 245, 245);
  border: 2px solid rgb(9, 9, 9);
  color: rgb(12, 11, 11);
  padding: 10px 16px;
  border-radius: 12px;
  font-family: 'DynaPuff', cursive;
  font-size: 18px;
  cursor: pointer;
}

#startGameBtn {
  bottom: 34px;
}

.main-title {
  font-size: 42px;
  font-weight: 800;
  color: white;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 32px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.pravila-text {
  margin-top: 10px;
  max-width: 520px;
  font-size: 20px;
  line-height: 1.4;
  color: white;
  opacity: 0.9;
}

.challenge-types {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 30px;
  column-gap: 40px;
  text-align: left;
}

.challenge-type {
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.challenge-type:hover {
  text-decoration: underline;
}

.result-deck {
  width: min(100%, 340px);
}

.result-card {
  width: 100%;
  margin-top: 0;
  padding: 40px 30px 42px;
  text-align: left;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbf8 100%);
  border: 2px solid rgba(17, 17, 17, 0.14);
  border-radius: 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 18px 34px rgba(21, 16, 12, 0.16),
    0 6px 12px rgba(21, 16, 12, 0.08);
  position: relative;
  overflow: hidden;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.26s ease, opacity 0.26s ease;
  will-change: transform, opacity;
}

.result-card.card-exit {
  opacity: 0;
  transform: translateX(-64px);
}

.result-card.card-enter {
  opacity: 0;
  transform: translateX(64px);
  animation: card-in 340ms ease forwards;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent 38%);
  pointer-events: none;
  z-index: 0;
}

.result-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px solid rgba(17, 17, 17, 0.05);
  background: transparent;
  pointer-events: none;
  z-index: 0;
}

.result-section {
  width: 100%;
  position: relative;
  z-index: 1;
}

.result-section + .result-section {
  margin-top: 30px;
}

.result-section-primary {
  margin-bottom: 4px;
}

.result-section-task {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(36, 23, 14, 0.1);
}

.result-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(36, 23, 14, 0.45);
  margin-bottom: 12px;
  text-align: left;
}

.result-player {
  font-size: 44px;
  line-height: 1.08;
  color: #24170e;
  margin-bottom: 0;
  text-shadow: none;
  text-align: left;
}

.result-challenge {
  display: inline-block;
  font-size: 24px;
  line-height: 1.2;
  color: #2d1d12;
  margin-bottom: 0;
  text-align: left;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(242, 236, 227, 0.95);
  border: 1px solid rgba(79, 63, 46, 0.1);
}

.result-prompt {
  font-size: 24px;
  line-height: 1.55;
  color: #1d140d;
  font-weight: 700;
  padding: 0;
  max-width: 27ch;
  margin: 0;
  text-align: left;
  text-wrap: balance;
}

.result-btn {
  bottom: 48px;
  background: linear-gradient(180deg, #ffffff, #f3ede4);
  border-color: rgba(36, 23, 14, 0.18);
  box-shadow: 0 10px 22px rgba(21, 16, 12, 0.14);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: white;
  color: #111;
  padding: 24px;
  border-radius: 16px;
  max-width: 300px;
  text-align: center;
}

.modal-content h3 {
  margin-bottom: 10px;
}

.modal-content button {
  margin-top: 20px;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateX(64px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 62px;
  }

  .screen-title,
  .main-title {
    font-size: 34px;
  }

  .input-row {
    width: 100%;
    flex-direction: column;
  }

  .players-list-wrapper {
    width: 100%;
  }

  .challenge-types {
    width: 100%;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .result-player {
    font-size: 36px;
  }

  .result-deck {
    width: min(100%, 320px);
  }

  .result-challenge {
    font-size: 23px;
  }

  .result-prompt {
    font-size: 20px;
    max-width: none;
  }
}
