*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Основная детская палитра */
  --pink: #FF6B9D;
  --pink-dark: #C239B3;
  --violet: #7D46FF;
  --yellow: #FFD700;
  --orange: #FFA500;
  --green: #5CD85A;
  --green-light: #A8F75D;

  --bg-main: linear-gradient(135deg, #FFE5F5 0%, #E5F5FF 50%, #FFF5E5 100%);
  --card-bg: linear-gradient(135deg, #FFFFFF 0%, #FFF5F8 50%, #F0F8FF 100%);

  --shadow-strong: 0 12px 40px rgba(125, 70, 255, 0.25);
  --shadow-soft: 0 6px 20px rgba(125, 70, 255, 0.18);
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: #111111;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
}

/* Весёлый фон со звёздочками и облаками */
body::before {
  content: "⭐ ✨ 🌟 💫 ⭐ ✨ 🌟 💫 ⭐ ✨ 🌟 💫";
  position: fixed;
  top: -50px;
  left: 0;
  right: 0;
  font-size: 24px;
  text-align: center;
  letter-spacing: 40px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  animation: floatStars 20s linear infinite;
}

body::after {
  content: none;
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-24px) rotate(-1.5deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9) rotate(-3deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

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

@keyframes rewardEarned {
  0% {
    transform: scale(0.5) rotate(-15deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.3) rotate(15deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

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

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg); }
  75% { transform: rotate(6deg); }
}

@keyframes floatStars {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(10px) translateX(20px); }
  100% { transform: translateY(0) translateX(0); }
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  animation: fadeIn 0.3s ease-out;
}

.hidden {
  display: none !important;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  min-height: 56px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 250, 240, 0.94) 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(125, 70, 255, 0.15);
  border-bottom: 3px solid var(--yellow);
  position: relative;
  z-index: 1;
}

.header::after {
  content: "🎨 🎪 🎭 🎨";
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  letter-spacing: 26px;
  opacity: 0.4;
  pointer-events: none;
}

@media (min-width: 768px) {
  .header {
    padding: 16px 24px;
    min-height: 64px;
  }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: bounce 2s ease-in-out infinite;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.logo-link:hover {
  opacity: 0.8;
}

.logo-link:active {
  opacity: 0.6;
}

.logo-image {
  height: 32px;
  width: auto;
  object-fit: contain;
  animation: wiggle 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(125, 70, 255, 0.3));
}

.logo-small-image {
  height: 24px;
}

@media (min-width: 768px) {
  .logo-image {
    height: 40px;
  }
  
  .logo-small-image {
    height: 28px;
  }
}

.logo,
.logo-small {
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 18px;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.5px;
}

@media (min-width: 768px) {
  .logo,
  .logo-small {
    font-size: 20px;
  }
}

.main {
  padding: 16px;
  display: flex;
  justify-content: center;
  flex: 1;
}

@media (min-width: 768px) {
  .main {
    padding: 24px 24px 40px;
  }
}

.card.surface {
  background: var(--card-bg);
  border-radius: 32px;
  box-shadow: 
    var(--shadow-strong),
    0 6px 20px rgba(255, 215, 0, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.85);
  padding: 28px;
  width: 100%;
  max-width: 720px;
  border: 4px solid;
  border-image: linear-gradient(135deg, var(--pink) 0%, var(--yellow) 50%, var(--violet) 100%) 1;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: visible;
}

.card.surface::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.card.surface:hover {
  box-shadow: 
    0 20px 60px rgba(125, 70, 255, 0.3),
    0 10px 30px rgba(255, 215, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-8px) scale(1.02);
}

.card.surface:hover::before {
  opacity: 1;
}

@media (min-width: 768px) {
  .card.surface {
    padding: 32px;
  }
}

/* Minecraft Hero Styles */
.minecraft-hero-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 30px;
  padding: 36px;
  background: linear-gradient(135deg, #FFE5F5 0%, #E5F5FF 50%, #FFF5E5 100%);
  border-radius: 40px;
  box-shadow: 
    0 16px 48px rgba(125, 70, 255, 0.25),
    0 8px 24px rgba(255, 215, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
  animation: fadeIn 0.8s ease-out;
  border: 4px solid var(--yellow);
  position: relative;
  overflow: hidden;
}

.minecraft-hero-container::after {
  content: "✨";
  position: absolute;
  font-size: 32px;
  animation: pulse 2s ease-in-out infinite;
  opacity: 0.6;
  right: 24px;
  top: 18px;
}

.minecraft-hero-container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(168, 247, 93, 0.1) 0%, transparent 70%);
  animation: rotateGradient 8s linear infinite;
}

@keyframes rotateGradient {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.minecraft-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: heroBounce 2s ease-in-out infinite;
  transform-origin: center bottom;
}

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

.minecraft-head {
  width: 60px;
  height: 60px;
  background: #8B7355;
  border: 3px solid #5D4E37;
  position: relative;
  margin-bottom: 2px;
  box-shadow: 
    inset 0 0 0 2px #A68B6F,
    0 4px 8px rgba(0, 0, 0, 0.2);
}

.minecraft-face {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: #D4A574;
  border: 2px solid #8B7355;
}

.minecraft-eye {
  position: absolute;
  top: 12px;
  width: 8px;
  height: 8px;
  background: #000000;
  border: 1px solid #333333;
}

.minecraft-eye.eye-left {
  left: 12px;
}

.minecraft-eye.eye-right {
  right: 12px;
}

.minecraft-mouth {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 8px;
  background: #000000;
  border: 1px solid #333333;
  border-radius: 0 0 8px 8px;
}

.minecraft-body {
  position: relative;
  width: 56px;
  height: 80px;
  margin-bottom: 2px;
}

.minecraft-chest {
  width: 100%;
  height: 100%;
  background: #7D46FF;
  border: 3px solid #5D2FCC;
  box-shadow: 
    inset 0 0 0 2px #9D66FF,
    0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}

.minecraft-chest::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: #A8F75D;
  border: 2px solid #7D46FF;
  border-radius: 4px;
}

.minecraft-arms {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 60px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.minecraft-arm {
  width: 20px;
  height: 60px;
  background: #8B7355;
  border: 2px solid #5D4E37;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.minecraft-arm.arm-left {
  animation: armSwingLeft 2s ease-in-out infinite;
  transform-origin: top center;
}

.minecraft-arm.arm-right {
  animation: armSwingRight 2s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes armSwingLeft {
  0%, 100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

@keyframes armSwingRight {
  0%, 100% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(-10deg);
  }
}

.minecraft-legs {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}

.minecraft-leg {
  width: 26px;
  height: 50px;
  background: #5D4E37;
  border: 2px solid #3D2E27;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.minecraft-leg.leg-left {
  animation: legMoveLeft 2s ease-in-out infinite;
}

.minecraft-leg.leg-right {
  animation: legMoveRight 2s ease-in-out infinite;
}

@keyframes legMoveLeft {
  0%, 100% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(-2px) rotate(-5deg);
  }
}

@keyframes legMoveRight {
  0%, 100% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(2px) rotate(5deg);
  }
}


@media (max-width: 480px) {
  .minecraft-hero-container {
    margin: 20px 0 24px;
    padding: 24px;
  }

  .minecraft-head {
    width: 50px;
    height: 50px;
  }

  .minecraft-body {
    width: 46px;
    height: 70px;
  }

  .minecraft-arms {
    width: 100px;
    top: 50px;
  }

  .minecraft-arm {
    width: 18px;
    height: 50px;
  }

  .minecraft-leg {
    width: 22px;
    height: 45px;
  }

  .minecraft-logo-text {
    font-size: 16px;
    top: -35px;
  }
}

.title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  animation: fadeIn 0.5s ease-out;
  text-align: center;
  letter-spacing: -0.4px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

/* Email Form Styles */
.email-form-container {
  margin: 20px 0;
  padding: 20px;
  background: linear-gradient(135deg, #EFE9FF 0%, #f5f0ff 100%);
  border-radius: 20px;
  border: 2px solid rgba(125, 70, 255, 0.15);
  box-shadow: 
    0 4px 12px rgba(125, 70, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-form-label {
  font-size: 14px;
  font-weight: 600;
  color: #7D46FF;
  text-align: center;
}

.email-form-input-group {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.email-form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.email-form-input-icon {
  position: absolute;
  left: 16px;
  color: #7D46FF;
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
  transition: all 0.3s ease;
}

.email-form-input-wrapper:focus-within .email-form-input-icon {
  opacity: 1;
  transform: scale(1.1);
}

.email-form-input {
  flex: 1;
  padding: 14px 18px 14px 48px;
  border-radius: 16px;
  border: 2px solid rgba(125, 70, 255, 0.15);
  font-size: 16px;
  font-family: inherit;
  background: linear-gradient(135deg, #ffffff 0%, #faf9ff 100%);
  color: #333333;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 8px rgba(125, 70, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  width: 100%;
}

.email-form-input:focus {
  outline: none;
  border-color: #7D46FF;
  box-shadow: 
    0 0 0 4px rgba(125, 70, 255, 0.15),
    0 4px 12px rgba(125, 70, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding-left: 50px;
}

.email-form-input-wrapper:has(input[type="password"]) {
  flex-direction: column;
  align-items: stretch;
}

.email-form-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #7D46FF;
  opacity: 0.6;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
  border-radius: 8px;
}

.email-form-toggle-password:hover {
  opacity: 1;
  background: rgba(125, 70, 255, 0.1);
}

.email-form-toggle-password:active {
  transform: translateY(-50%) scale(0.95);
}

.email-form-toggle-password svg {
  width: 20px;
  height: 20px;
}

.email-form-forgot-wrapper {
  margin-top: 6px;
  text-align: right;
  padding-right: 4px;
}

.email-form-btn {
  min-width: 120px;
  white-space: nowrap;
}

.email-form-btn-full {
  width: 100%;
  margin-top: 8px;
}

.email-form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.email-form-forgot-btn {
  font-size: 13px;
  padding: 6px 8px;
  text-align: right;
  color: #7D46FF;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.2s ease;
  font-weight: 500;
  border-radius: 8px;
}

.email-form-forgot-btn:hover {
  opacity: 1;
  background: rgba(125, 70, 255, 0.08);
  text-decoration: underline;
}

.email-form-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.email-form-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.email-form-btn .btn-text {
  transition: opacity 0.2s ease;
}

.email-form-btn .btn-loader {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-form-btn:disabled .btn-text {
  opacity: 0;
}

.email-form-btn:disabled .btn-loader {
  display: flex !important;
}

.email-form-btn .btn-loader svg {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.email-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
}

.email-form-checkbox-input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #7D46FF;
  flex-shrink: 0;
}

.email-form-checkbox-label {
  font-size: 13px;
  color: #333333;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

.email-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.email-form-field-label {
  font-size: 13px;
  font-weight: 500;
  color: #555555;
}

.email-form-consent-notice {
  font-size: 13px;
  color: #555555;
  text-align: center;
  margin: 12px 0 8px;
  line-height: 1.5;
  padding: 12px;
  background: linear-gradient(135deg, #f5fff0 0%, #ffffff 100%);
  border-radius: 12px;
  border: 1px solid rgba(168, 247, 93, 0.3);
  font-weight: 500;
}

.email-form-info {
  font-size: 12px;
  color: #666666;
  text-align: center;
  margin: 8px 0 0;
  line-height: 1.5;
}

.email-form-link {
  color: #7D46FF;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.email-form-link:hover {
  color: #6a39e0;
}

.email-form-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #999999;
  font-size: 13px;
}

.email-form-divider::before,
.email-form-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e0e0e0;
}

.email-form-divider span {
  padding: 0 12px;
}

.email-form-guest-btn {
  width: 100%;
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.6;
  text-decoration: underline;
}

.email-form-guest-btn:hover {
  opacity: 0.8;
}

.btn-logout {
  font-size: 14px;
  padding: 8px 16px;
  color: #666666;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.2s;
  font-weight: 500;
  margin-left: auto;
}

.btn-logout:hover {
  opacity: 1;
  color: #7D46FF;
}

.btn-logout.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.btn-logout:not(.hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 0.8 !important;
}

@media (max-width: 767px) {
  .btn-logout {
    font-size: 13px;
    padding: 6px 12px;
  }
}

.btn-link {
  background: transparent;
  border: none;
  color: #666666;
  padding: 8px 12px;
  font-weight: 400;
  box-shadow: none;
}

.btn-link:hover {
  background: transparent;
  color: #333333;
  transform: none;
  box-shadow: none;
}

.game-actions-container {
  animation: fadeIn 0.5s ease-out;
}

.email-form-status {
  font-size: 13px;
  text-align: center;
  min-height: 18px;
  margin: 8px 0 0;
  font-weight: 500;
}

.subtitle {
  margin: 0 0 16px;
  font-size: 15px;
  color: #333333;
  line-height: 1.5;
  animation: fadeIn 0.5s ease-out 0.1s both;
}

#card-progress-text {
  margin-top: 20px;
  text-align: center;
}

.game-rules {
  margin: 20px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f5fff0 0%, #ffffff 100%);
  border-radius: 16px;
  border: 2px solid rgba(168, 247, 93, 0.3);
  box-shadow: 
    0 4px 12px rgba(168, 247, 93, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.game-rules-text {
  margin: 0;
  font-size: 14px;
  color: #333333;
  line-height: 1.6;
  text-align: center;
}

.game-rules-text strong {
  color: #7D46FF;
  font-weight: 600;
}

@media (min-width: 768px) {
  .subtitle {
    font-size: 16px;
  }
}

.field {
  margin-top: 16px;
}

.field-label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: #333333;
}

.select {
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  border: 2px solid rgba(125, 70, 255, 0.15);
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  background: linear-gradient(135deg, #ffffff 0%, #faf9ff 100%);
  color: #333333;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 8px rgba(125, 70, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.select:hover {
  border-color: #A8F75D;
  box-shadow: 
    0 4px 12px rgba(168, 247, 93, 0.2),
    0 2px 6px rgba(168, 247, 93, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.select:focus {
  outline: none;
  border-color: #7D46FF;
  box-shadow: 
    0 0 0 4px rgba(125, 70, 255, 0.15),
    0 4px 12px rgba(125, 70, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.home-actions .btn {
  width: 100%;
}

@media (min-width: 768px) {
  .home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

.home-modes-hint {
  margin-top: 20px;
  font-size: 13px;
  color: #555555;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .home-modes-hint {
    font-size: 14px;
    max-width: 100%;
  }
}

.btn {
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 16px 28px;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--orange) 100%);
  color: #FFFFFF;
  box-shadow: 
    0 8px 24px rgba(255, 215, 0, 0.5),
    0 4px 12px rgba(255, 165, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
  font-weight: 800;
  border: 3px solid var(--pink);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  animation: pulse 2s ease-in-out infinite;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--orange) 0%, #FF8C00 100%);
  box-shadow: 
    0 12px 32px rgba(255, 215, 0, 0.6),
    0 6px 16px rgba(255, 165, 0, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-6px) scale(1.05) rotate(-2deg);
}

.btn-primary:active {
  transform: translateY(-2px) scale(0.97) rotate(0deg);
}

.btn-primary:focus-visible {
  outline: 2px solid #7D46FF;
  outline-offset: 2px;
}

.btn-secondary {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  color: #333333;
  border: 2px solid #A8F75D;
  font-weight: 600;
  box-shadow: 
    0 2px 8px rgba(168, 247, 93, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #f5fff0 0%, #ffffff 100%);
  border-color: #9ae54d;
  box-shadow: 
    0 6px 20px rgba(168, 247, 93, 0.3),
    0 2px 8px rgba(168, 247, 93, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-2px) scale(1.01);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(168, 247, 93, 0.2);
}

.btn-secondary:focus-visible {
  outline: 2px solid #7D46FF;
  outline-offset: 2px;
}

.btn-success {
  background-color: #5CD85A;
  color: #111111;
  font-weight: 600;
}

.btn-success:hover {
  background-color: #4fc64d;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}

.btn-success:focus-visible {
  outline: 2px solid #7D46FF;
  outline-offset: 2px;
}

.btn-outline {
  background-color: #ffffff;
  color: #333333;
  border: 1px solid #A8F75D;
  font-weight: 500;
}

.btn-outline:hover {
  background-color: #F5F5F5;
  border-color: #9ae54d;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}

.btn-outline:focus-visible {
  outline: 2px solid #7D46FF;
  outline-offset: 2px;
}

.btn-back {
  border: none;
  background: transparent;
  color: #7D46FF;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.15s ease;
}

.btn-back:hover {
  color: #6a39e0;
}

.btn-back:focus-visible {
  outline: 2px solid #7D46FF;
  outline-offset: 2px;
  border-radius: 4px;
}

.progress-text {
  margin-top: 16px;
  font-size: 14px;
  color: #333333;
}

.session-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.session-size-btn {
  animation: fadeIn 0.4s ease-out both;
}

.session-size-btn:nth-child(1) { animation-delay: 0.05s; }
.session-size-btn:nth-child(2) { animation-delay: 0.1s; }
.session-size-btn:nth-child(3) { animation-delay: 0.15s; }
.session-size-btn:nth-child(4) { animation-delay: 0.2s; }
.session-size-btn:nth-child(5) { animation-delay: 0.25s; }

@media (min-width: 480px) {
  .session-size-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
  }
}

.session-size-btn {
  text-align: center;
}

.categories-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 20px;
  border: 2px solid rgba(125, 70, 255, 0.15);
  background: linear-gradient(135deg, #EFE9FF 0%, #ffffff 100%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideIn 0.4s ease-out both;
  box-shadow: 
    0 4px 12px rgba(125, 70, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.category-item:nth-child(1) { animation-delay: 0.05s; }
.category-item:nth-child(2) { animation-delay: 0.1s; }
.category-item:nth-child(3) { animation-delay: 0.15s; }
.category-item:nth-child(4) { animation-delay: 0.2s; }
.category-item:nth-child(5) { animation-delay: 0.25s; }
.category-item:nth-child(6) { animation-delay: 0.3s; }

.category-item:hover {
  border-color: #A8F75D;
  box-shadow: 
    0 8px 24px rgba(168, 247, 93, 0.25),
    0 4px 12px rgba(168, 247, 93, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-4px) scale(1.02);
  background: linear-gradient(135deg, #ffffff 0%, #f5fff0 100%);
}

@media (min-width: 480px) {
  .category-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
  }
}

.category-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-title {
  font-size: 16px;
  font-weight: 500;
}

.category-progress {
  font-size: 14px;
  color: #333333;
}

.card-flip-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #EFE9FF 0%, #f5f0ff 100%);
  font-size: 13px;
  font-weight: 600;
  color: #7D46FF;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(125, 70, 255, 0.2);
  box-shadow: 
    0 2px 6px rgba(125, 70, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tag:hover {
  transform: scale(1.08) translateY(-1px);
  box-shadow: 
    0 4px 12px rgba(125, 70, 255, 0.25),
    0 2px 6px rgba(125, 70, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, #f5f0ff 0%, #EFE9FF 100%);
}

.tag-counter {
  background: #111111;
  color: #ffffff;
}

.flip-container {
  perspective: 1000px;
  margin-top: 8px;
}

.flip-inner {
  position: relative;
  width: 100%;
  min-height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeIn 0.5s ease-out;
}

@media (min-width: 768px) {
  .flip-inner {
    min-height: 240px;
  }
}

.flip-inner.is-flipped {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  width: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 64px 12px 16px;
}

.btn-play-sound {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #111111;
  background: linear-gradient(135deg, #A8F75D 0%, #9ae54d 100%);
  color: #111111;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 16px rgba(168, 247, 93, 0.4),
    0 2px 8px rgba(168, 247, 93, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  animation: fadeIn 0.5s ease-out 0.3s both;
}

.btn-play-sound:hover {
  background: linear-gradient(135deg, #9ae54d 0%, #8ad53d 100%);
  transform: scale(1.15) rotate(8deg);
  box-shadow: 
    0 8px 24px rgba(168, 247, 93, 0.5),
    0 4px 12px rgba(168, 247, 93, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border-color: #111111;
}

.btn-play-sound:active {
  transform: scale(1.05) rotate(0deg);
  box-shadow: 
    0 4px 12px rgba(168, 247, 93, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-play-sound:focus-visible {
  outline: 2px solid #7D46FF;
  outline-offset: 2px;
}

.flip-back {
  transform: rotateY(180deg);
}

.card-icon {
  font-size: 64px;
  text-align: center;
  margin: 16px 0 12px;
  line-height: 1;
  animation: bounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.card-en {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin: 20px 0;
  color: #111111;
  line-height: 1.4;
  padding: 0 8px;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.card-ru {
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  margin: 20px 0 8px;
  color: #111111;
  line-height: 1.5;
  padding: 0 8px;
  animation: fadeIn 0.6s ease-out 0.3s both;
}

.card-context {
  font-size: 14px;
  color: #7D46FF;
  text-align: center;
  margin: 12px 0 8px;
  padding: 8px 12px;
  background: #EFE9FF;
  border-radius: 6px;
  font-style: italic;
  line-height: 1.4;
  animation: fadeIn 0.6s ease-out 0.4s both;
}

.card-note {
  font-size: 14px;
  color: #333333;
  text-align: center;
  margin: 0 0 16px;
}

/* Audio Mode Styles */
.audio-mode-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 233, 255, 0.95) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 32px;
  animation: fadeIn 0.3s ease-out;
  backdrop-filter: blur(10px);
  padding: 24px 20px 20px;
  box-sizing: border-box;
}

/* Hide elements when audio mode overlay is visible */
.card-flip-wrapper:has(.audio-mode-overlay:not(.hidden)) .card-meta,
.card-flip-wrapper:has(.audio-mode-overlay:not(.hidden)) #card-progress-text {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.flip-inner.audio-mode-active {
  position: relative;
}

.audio-mode-icon {
  font-size: 120px;
  margin-bottom: 40px;
  animation: pulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(125, 70, 255, 0.3));
}

.audio-mode-buttons {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 36px;
}

.btn-audio-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 12px;
  font-weight: 600;
  color: #333333;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.audio-mode-hint {
  margin-top: 12px;
  font-size: 15px;
  text-align: center;
  color: #333333;
  max-width: 420px;
  line-height: 1.6;
  margin-left: auto;
  margin-right: auto;
}

.audio-mode-translation {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #7D46FF;
  max-width: 420px;
}

.btn-audio-action {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: none;
  font-size: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  -webkit-tap-highlight-color: transparent;
}

.btn-audio-happy {
  background: linear-gradient(135deg, #A8F75D 0%, #9ae54d 100%);
}

.btn-audio-happy:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(168, 247, 93, 0.4);
}

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

.btn-audio-repeat {
  background: linear-gradient(135deg, #7D46FF 0%, #6a39e0 100%);
}

.btn-audio-repeat:hover {
  transform: scale(1.15) rotate(180deg);
  box-shadow: 0 6px 20px rgba(125, 70, 255, 0.4);
}

.btn-audio-repeat:active {
  transform: scale(0.95) rotate(180deg);
}

.btn-audio-translate {
  background: linear-gradient(135deg, #F7E65D 0%, #f5d84d 100%);
  border: 3px solid #7D46FF;
}

.btn-audio-translate:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(247, 230, 93, 0.4);
  border-color: #6a39e0;
}

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

.btn-audio-next {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border: 3px solid #7D46FF;
}

.btn-audio-next:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(125, 70, 255, 0.3);
  background: #EFE9FF;
}

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

@media (max-width: 480px) {
  .audio-mode-icon {
    font-size: 80px;
    margin-bottom: 20px;
  }

  .btn-audio-action {
    width: 72px;
    height: 72px;
    font-size: 32px;
  }

  .audio-mode-buttons {
    gap: 14px;
    margin-bottom: 32px;
  }

  .btn-audio-label {
    bottom: -20px;
    font-size: 11px;
  }

  .audio-mode-hint {
    font-size: 13px;
    max-width: 320px;
    padding: 0 8px;
  }
}

/* Hide text elements in audio mode */
.flip-inner.audio-mode-active .card-en,
.flip-inner.audio-mode-active .card-ru,
.flip-inner.audio-mode-active .card-context,
.flip-inner.audio-mode-active .flip-btn,
.flip-inner.audio-mode-active .card-actions,
.flip-inner.audio-mode-active .btn-play-sound {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.flip-inner.audio-mode-active .card-icon {
  font-size: 80px !important;
  margin: 40px 0;
}

/* Hide card meta and progress text in audio mode - simple class-based approach */
.card-flip-wrapper.audio-mode-enabled .card-meta,
.card-flip-wrapper.audio-mode-enabled ~ .subtitle,
.audio-mode-enabled .card-meta,
.audio-mode-enabled ~ #card-progress-text {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Additional selector for progress text inside card wrapper */
.card.surface:has(.audio-mode-enabled) #card-progress-text,
.card.surface .audio-mode-enabled ~ #card-progress-text {
  display: none !important;
}

.flip-btn {
  margin-top: 16px;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
  width: 100%;
}

@media (min-width: 480px) {
  .card-actions {
    flex-direction: row;
    gap: 12px;
  }
}

.card-actions .btn {
  flex: 1;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.memory-match-header {
  margin-bottom: 20px;
}

.memory-stats {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
  max-width: 100%;
}

@media (min-width: 480px) {
  .memory-grid {
    gap: 12px;
  }
}

.memory-card {
  aspect-ratio: 1;
  cursor: pointer;
  perspective: 1000px;
  animation: fadeIn 0.4s ease-out both;
}

.memory-card:nth-child(1) { animation-delay: 0.05s; }
.memory-card:nth-child(2) { animation-delay: 0.1s; }
.memory-card:nth-child(3) { animation-delay: 0.15s; }
.memory-card:nth-child(4) { animation-delay: 0.2s; }
.memory-card:nth-child(5) { animation-delay: 0.25s; }
.memory-card:nth-child(6) { animation-delay: 0.3s; }
.memory-card:nth-child(7) { animation-delay: 0.35s; }
.memory-card:nth-child(8) { animation-delay: 0.4s; }
.memory-card:nth-child(9) { animation-delay: 0.45s; }
.memory-card:nth-child(10) { animation-delay: 0.5s; }
.memory-card:nth-child(11) { animation-delay: 0.55s; }
.memory-card:nth-child(12) { animation-delay: 0.6s; }
.memory-card:nth-child(13) { animation-delay: 0.65s; }
.memory-card:nth-child(14) { animation-delay: 0.7s; }
.memory-card:nth-child(15) { animation-delay: 0.75s; }
.memory-card:nth-child(16) { animation-delay: 0.8s; }

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card.matched {
  opacity: 0.6;
  cursor: default;
  animation: pulse 0.6s ease-out;
}

.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.memory-card-front {
  background: #7D46FF;
  color: #ffffff;
  transform: rotateY(0deg);
}

.memory-card-back {
  background: #ffffff;
  color: #111111;
  border: 2px solid #A8F75D;
  transform: rotateY(180deg);
}

.memory-card-en {
  font-size: 13px;
  font-weight: 600;
}

.memory-card-ru {
  font-size: 12px;
  font-weight: 500;
}

.memory-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

@media (min-width: 480px) {
  .memory-actions {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .title {
    font-size: 24px;
  }

  .card-en {
    font-size: 24px;
    margin: 24px 0;
  }

  .card-ru {
    font-size: 22px;
    margin: 24px 0 8px;
  }

  .btn {
    font-size: 16px;
    padding: 14px 28px;
  }

  .memory-grid {
    gap: 16px;
  }

  .memory-card-front,
  .memory-card-back {
    font-size: 16px;
    padding: 12px;
  }

  .memory-card-en {
    font-size: 15px;
  }

  .memory-card-ru {
    font-size: 14px;
  }
}

.home-stats-links {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.home-stats-links .btn {
  flex: 1;
  min-width: 140px;
}

.inventory-link {
  margin-top: 20px;
  text-align: center;
}

.inventory-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
  padding: 24px;
  background: linear-gradient(135deg, #EFE9FF 0%, #f5f0ff 50%, #EFE9FF 100%);
  border-radius: 24px;
  animation: fadeIn 0.5s ease-out 0.2s both;
  box-shadow: 
    0 8px 24px rgba(125, 70, 255, 0.15),
    0 4px 12px rgba(125, 70, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(125, 70, 255, 0.15);
}

.inventory-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.inventory-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #7D46FF;
  line-height: 1;
  transition: transform 0.3s ease;
}

.inventory-stat-item:hover .inventory-stat-value {
  transform: scale(1.1);
}

.inventory-stat-label {
  font-size: 14px;
  color: #333333;
  text-align: center;
}

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.reward-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  border-radius: 20px;
  border: 2px solid rgba(125, 70, 255, 0.15);
  background: linear-gradient(135deg, #ffffff 0%, #faf9ff 100%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 140px;
  justify-content: space-between;
  animation: fadeIn 0.5s ease-out both;
  cursor: pointer;
  box-shadow: 
    0 4px 12px rgba(125, 70, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.reward-card:nth-child(1) { animation-delay: 0.05s; }
.reward-card:nth-child(2) { animation-delay: 0.1s; }
.reward-card:nth-child(3) { animation-delay: 0.15s; }
.reward-card:nth-child(4) { animation-delay: 0.2s; }
.reward-card:nth-child(5) { animation-delay: 0.25s; }
.reward-card:nth-child(6) { animation-delay: 0.3s; }
.reward-card:nth-child(7) { animation-delay: 0.35s; }
.reward-card:nth-child(8) { animation-delay: 0.4s; }
.reward-card:nth-child(9) { animation-delay: 0.45s; }
.reward-card:nth-child(10) { animation-delay: 0.5s; }

.reward-card.reward-earned {
  border-color: #A8F75D;
  background: linear-gradient(135deg, #ffffff 0%, #f0ffe0 50%, #ffffff 100%);
  box-shadow: 
    0 8px 24px rgba(168, 247, 93, 0.35),
    0 4px 12px rgba(168, 247, 93, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: rewardEarned 0.6s ease-out both;
}

.reward-card.reward-earned:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 
    0 12px 32px rgba(168, 247, 93, 0.45),
    0 6px 16px rgba(168, 247, 93, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.reward-card.reward-unlocked {
  border-color: #7D46FF;
  background: linear-gradient(135deg, #ffffff 0%, #f5f0ff 100%);
}

.reward-card.reward-unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(125, 70, 255, 0.2);
}

.reward-card.reward-locked {
  opacity: 0.5;
  background: #F5F5F5;
  cursor: default;
}

.reward-card:not(.reward-locked):hover .reward-icon {
  animation: pulse 0.6s ease-in-out;
}

.reward-icon {
  font-size: 40px;
  margin-bottom: 8px;
  line-height: 1;
}

.reward-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  width: 100%;
}

.reward-title {
  font-size: 14px;
  font-weight: 600;
  color: #111111;
}

.reward-description {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
}

.inventory-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

@media (min-width: 480px) {
  .rewards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .reward-card {
    min-height: 160px;
    padding: 20px 16px;
  }

  .reward-icon {
    font-size: 48px;
  }

  .reward-title {
    font-size: 15px;
  }

  .reward-description {
    font-size: 13px;
  }
}

@media (min-width: 768px) {
  .rewards-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
  }

  .inventory-stat-value {
    font-size: 36px;
  }

  .inventory-stat-label {
    font-size: 15px;
  }
}

/* Stats Screen Styles */
.stats-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(125, 70, 255, 0.1);
  background: linear-gradient(135deg, rgba(125, 70, 255, 0.05) 0%, rgba(239, 233, 255, 0.3) 100%);
  margin: -24px -24px 32px -24px;
  padding: 28px 24px 24px;
  border-radius: 24px 24px 0 0;
}

.stats-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #7D46FF 0%, #A27CFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.stats-subtitle {
  font-size: 16px;
  color: #666666;
  font-weight: 500;
  margin: 0;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-radius: 24px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(125, 70, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeIn 0.6s ease-out both;
  border: 2px solid transparent;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.15),
    0 8px 20px rgba(125, 70, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stat-card:hover::before {
  opacity: 0.6;
}

.stat-card-primary {
  border-color: rgba(125, 70, 255, 0.25);
  background: linear-gradient(135deg, #EFE9FF 0%, #f5f0ff 50%, #ffffff 100%);
  color: #7D46FF;
}

.stat-card-primary::before {
  background: linear-gradient(90deg, transparent, #7D46FF, transparent);
}

.stat-card-success {
  border-color: rgba(168, 247, 93, 0.35);
  background: linear-gradient(135deg, #f5fff0 0%, #f0ffe0 50%, #ffffff 100%);
  color: #5CD85A;
}

.stat-card-success::before {
  background: linear-gradient(90deg, transparent, #A8F75D, transparent);
}

.stat-card-info {
  border-color: rgba(92, 216, 90, 0.35);
  background: linear-gradient(135deg, #f0fff0 0%, #e8ffe8 50%, #ffffff 100%);
  color: #5CD85A;
}

.stat-card-info::before {
  background: linear-gradient(90deg, transparent, #5CD85A, transparent);
}

.stat-card-warning {
  border-color: rgba(247, 230, 93, 0.35);
  background: linear-gradient(135deg, #fffef5 0%, #fffce8 50%, #ffffff 100%);
  color: #F7E65D;
}

.stat-card-warning::before {
  background: linear-gradient(90deg, transparent, #F7E65D, transparent);
}

.stat-card-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: scaleIn 0.6s ease-out 0.2s both;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.stat-card:hover .stat-card-icon {
  transform: scale(1.1) rotate(5deg);
}

.stat-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card-value {
  font-size: 42px;
  font-weight: 800;
  color: #111111;
  line-height: 1.1;
  margin-bottom: 10px;
  animation: fadeIn 0.7s ease-out 0.3s both;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #111111 0%, #333333 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s ease;
}

.stat-card:hover .stat-card-value {
  transform: scale(1.05);
}

.stat-card-label {
  font-size: 12px;
  color: #666666;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.stats-section {
  margin-top: 40px;
  animation: fadeIn 0.7s ease-out both;
}

.stats-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #111111;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, #7D46FF 0%, #A27CFF 50%, transparent 100%) 1;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-categories,
.stats-dictionaries {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-category-card,
.stats-dictionary-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-radius: 20px;
  padding: 20px;
  border: 2px solid rgba(125, 70, 255, 0.15);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(125, 70, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideIn 0.6s ease-out both;
  position: relative;
  overflow: hidden;
}

.stats-category-card::before,
.stats-dictionary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(125, 70, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.stats-category-card:hover::before,
.stats-dictionary-card:hover::before {
  left: 100%;
}

.stats-category-card:hover,
.stats-dictionary-card:hover {
  transform: translateX(6px) translateY(-2px);
  border-color: rgba(125, 70, 255, 0.4);
  box-shadow: 
    0 8px 24px rgba(125, 70, 255, 0.2),
    0 4px 12px rgba(125, 70, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stats-category-header,
.stats-dictionary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stats-category-name,
.stats-dictionary-name {
  font-size: 16px;
  font-weight: 700;
  color: #111111;
  letter-spacing: -0.2px;
}

.stats-category-progress,
.stats-dictionary-progress {
  font-size: 15px;
  font-weight: 700;
  color: #7D46FF;
  background: linear-gradient(135deg, #EFE9FF 0%, #f5f0ff 100%);
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(125, 70, 255, 0.2);
  box-shadow: 0 2px 4px rgba(125, 70, 255, 0.1);
  letter-spacing: 0.3px;
}

.stats-progress-bar {
  width: 100%;
  height: 16px;
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
}

.stats-progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.stats-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #7D46FF 0%, #9a5fff 50%, #A27CFF 100%);
  border-radius: 20px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 8px rgba(125, 70, 255, 0.5),
    0 1px 4px rgba(125, 70, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: progressFill 1.8s ease-out;
  position: relative;
  overflow: hidden;
}

.stats-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes progressFill {
  from {
    width: 0%;
  }
}

.stats-category-percent,
.stats-dictionary-percent {
  font-size: 14px;
  color: #7D46FF;
  font-weight: 700;
  text-align: right;
  letter-spacing: 0.3px;
}

.stats-extra {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-extra-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-radius: 16px;
  border: 2px solid rgba(125, 70, 255, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stat-extra-item:hover {
  border-color: rgba(125, 70, 255, 0.4);
  transform: translateX(6px) translateY(-2px);
  box-shadow: 
    0 6px 16px rgba(125, 70, 255, 0.15),
    0 2px 8px rgba(125, 70, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #ffffff 0%, #f5f0ff 100%);
}

.stat-extra-label {
  font-size: 15px;
  color: #666666;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.stat-extra-value {
  font-size: 20px;
  font-weight: 800;
  color: #7D46FF;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #7D46FF 0%, #A27CFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Settings Screen */
.settings-section {
  margin-top: 24px;
}

.settings-item {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f8f8;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.settings-item-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-item-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-item-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.settings-item-description {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #7D46FF;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px #7D46FF;
}

.settings-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.stats-empty {
  text-align: center;
  color: #999999;
  font-size: 14px;
  padding: 24px;
  font-style: italic;
}

@media (min-width: 768px) {
  .stats-title {
    font-size: 32px;
  }
  
  .stats-overview {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
  
  .stat-card-value {
    font-size: 48px;
  }
  
  .stat-card-icon {
    font-size: 64px;
  }
}
