/* Preloader Styles */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2c3e50, #4ca1af);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

.loader-container {
  text-align: center;
  max-width: 500px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.word-loader {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
}

.word-loader .letter {
  font-size: 2.5rem;
  font-weight: bold;
  color: white;
  margin: 0 5px;
  transform: translateY(0);
  animation: letterBounce 1.5s infinite ease-in-out;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Create staggered animation for each letter */
.word-loader .letter:nth-child(1) { animation-delay: 0.1s; color: #4cc9f0; }
.word-loader .letter:nth-child(2) { animation-delay: 0.2s; color: #f72585; }
.word-loader .letter:nth-child(3) { animation-delay: 0.3s; color: #7209b7; }
.word-loader .letter:nth-child(4) { animation-delay: 0.4s; color: #3a86ff; }
.word-loader .letter:nth-child(5) { animation-delay: 0.5s; color: #4cc9f0; }
.word-loader .letter:nth-child(6) { animation-delay: 0.6s; color: #f72585; }
.word-loader .letter:nth-child(7) { animation-delay: 0.7s; color: #7209b7; }
.word-loader .letter:nth-child(8) { animation-delay: 0.8s; color: #3a86ff; }
.word-loader .letter:nth-child(9) { animation-delay: 0.9s; color: #4cc9f0; }
.word-loader .letter:nth-child(10) { animation-delay: 1s; color: #f72585; }

@keyframes letterBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Animated bubbles */
.animated-bubbles {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.bubble {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  margin: 0 8px;
  animation: bubbleFloat 2s infinite ease-in-out;
}

.bubble:nth-child(1) { 
  background: #4cc9f0; 
  animation-delay: 0s; 
}
.bubble:nth-child(2) { 
  background: #f72585; 
  animation-delay: 0.2s; 
}
.bubble:nth-child(3) { 
  background: #7209b7; 
  animation-delay: 0.4s; 
}
.bubble:nth-child(4) { 
  background: #3a86ff; 
  animation-delay: 0.6s; 
}
.bubble:nth-child(5) { 
  background: #4cc9f0; 
  animation-delay: 0.8s; 
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Progress bar */
.progress-container {
  margin: 30px 0;
}

.progress-text {
  color: white;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4cc9f0, #f72585);
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.percentage {
  color: white;
  margin-top: 8px;
  font-size: 1rem;
}

/* Loading tips */
.loading-tips {
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  margin-top: 20px;
  animation: fadeInOut 3s infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Preloader exit animation */
#preloader.fade-out {
  animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
  to { opacity: 0; visibility: hidden; }
}
/* Main Page Styles */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    padding: 20px;
    text-align: center;
    perspective: 1000px;
}

.logo-container {
    margin-bottom: 40px;
    transform-style: preserve-3d;
}

.logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    transform: translateZ(30px);
}

.logo:hover {
    transform: translateZ(30px) scale(1.05);
}

.game-title {
    color: white;
    font-size: 3rem;
    margin: 0;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    transform: translateZ(40px);
}

.start-button {
    padding: 15px 40px;
    font-size: 1.2rem;
    background-color: #f72585;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    transform-style: preserve-3d;
    position: relative;
    transform: translateZ(20px);
}

.start-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    transform: translateZ(-10px);
    transition: all 0.3s ease;
}

.start-button:hover, .start-button:focus {
    background-color: #d81159;
    transform: translateY(-3px) translateZ(30px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    outline: none;
}

.start-button:hover:before {
    transform: translateZ(-15px);
}

/* Categories Page Styles */
.categories-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: 100vh;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    perspective: 1000px;
    position: relative;
    overflow: hidden;
}

.categories-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.9), rgba(58, 12, 163, 0.9));
    z-index: -1;
}

.categories-container:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="none" stroke="white" stroke-width="0.5" stroke-dasharray="5,5"/></svg>');
    opacity: 0.1;
    z-index: -1;
    transform: translateZ(-50px) scale(1.5);
}

.categories-title {
    color: white;
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateZ(30px);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 1fr));
    gap: 30px;
    justify-items: center;
    padding: 20px;
}

@media (max-width: 900px) {
    .categories-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.category-card {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.8s ease;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform-style: preserve-3d;
    position: relative;
}

.category-card:hover, .category-card:focus {
    transform: rotateY(20deg) translateY(-5px) scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    outline: none;
}

.category-card:active {
    transform: rotateY(180deg) scale(1.1);
}

.category-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
    backface-visibility: hidden;
    transform: translateZ(20px);
}

.category-card:hover img {
    transform: translateZ(20px) scale(1.05);
}

.category-card h3 {
    color: white;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
    transform: translateZ(30px);
}

/* Game Page Styles */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #ef233c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: var(--light-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    perspective: 1000px;
}

.game-container {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.5s ease-in-out;
    transform-style: preserve-3d;
    transform: rotateX(5deg);
    transition: transform 0.5s ease;
}

.game-container:hover {
    transform: rotateX(5deg) translateY(-10px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    text-align: center;
    margin-bottom: 30px;
    transform-style: preserve-3d;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateZ(20px);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    padding: 8px 20px;
    margin-bottom: 10px;
    transform-style: preserve-3d;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateZ(20px);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateZ(40px);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
}

.timer-item {
    color: #ff6b6b;
    background-color: rgba(239, 35, 60, 0.3);
    padding: 2px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.timer-item.warning {
    background-color: rgba(239, 35, 60, 0.6);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: translateZ(20px) scale(1); }
    50% { transform: translateZ(20px) scale(1.05); }
    100% { transform: translateZ(20px) scale(1); }
}

.guesses-left {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.word-display {
    font-size: 2rem;
    letter-spacing: 0.5em;
    margin: 30px 0;
    padding: 0 0.25em;
    text-align: center;
    font-weight: bold;
    color: white;
    text-shadow: 
        2px 2px 0 #3a0ca3,
        4px 4px 0 rgba(0, 0, 0, 0.2);
    min-height: 1.2em;
    transition: all 0.3s ease;
    transform: translateZ(40px);
}

.word-display span {
    display: inline-block;
    transition: transform 0.5s ease;
}

.hint-area {
    margin: 20px 0;
    text-align: center;
}

.hint-button {
    position: relative;
    background-color: var(--warning-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
}

.hint-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    transform: translateZ(-10px);
    transition: all 0.3s ease;
}

.hint-button:hover, .hint-button:focus {
    background-color: #f3722c;
    transform: translateY(-2px) translateZ(10px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    outline: none;
}

.hint-button:hover:before {
    transform: translateZ(-15px);
}

.hint-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hint-text {
    margin-top: 10px;
    font-style: italic;
    min-height: 1.5em;
    transform: translateZ(20px);
}

.guesses-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 10px 0;
}

.hearts {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.hearts span {
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    position: relative;
}

.hearts span:before {
    content: '❤️';
    position: absolute;
    top: 0;
    left: 0;
    transform: translateZ(-5px);
    opacity: 0.7;
}

.hearts span:hover {
    transform: translateZ(10px) rotateY(20deg);
}

.guessed-letters-container {
    text-align: center;
}

.guessed-letters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.guessed-letters span {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: popIn 0.3s ease;
    transform-style: preserve-3d;
    position: relative;
}

.guessed-letters span:before {
    content: attr(data-letter);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transform: translateZ(-5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guessed-letters span:hover {
    transform: translateZ(10px) rotateY(180deg);
}

@keyframes popIn {
    0% { transform: translateZ(-50px) scale(0); }
    80% { transform: translateZ(0) scale(1.1); }
    100% { transform: translateZ(0) scale(1); }
}

.input-area {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
}

#letter-input {
    width: 60px;
    height: 60px;
    font-size: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    box-shadow: 
        0 5px 0 rgba(255, 255, 255, 0.1),
        0 10px 0 rgba(255, 255, 255, 0.05);
}

#letter-input:focus {
    outline: none;
    box-shadow: 
        0 8px 0 rgba(255, 255, 255, 0.1),
        0 16px 0 rgba(255, 255, 255, 0.05);
    transform: translateZ(10px);
    background-color: rgba(255, 255, 255, 0.3);
}

.action-button {
    padding: 12px 25px;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    transform-style: preserve-3d;
    position: relative;
}

.action-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    transform: translateZ(-10px);
    transition: all 0.3s ease;
}

.action-button:hover, .action-button:focus {
    background-color: var(--secondary-color);
    transform: translateY(-2px) translateZ(10px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    outline: none;
}

.action-button:hover:before {
    transform: translateZ(-15px);
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

.quit-button {
    background-color: #6c757d;
}

.quit-button:hover, .quit-button:focus {
    background-color: #5a6268;
}

.restart-button {
    background-color: var(--accent-color);
}

.restart-button:hover, .restart-button:focus {
    background-color: #d81159;
}

.message {
    font-size: 1.2rem;
    margin: 20px 0;
    min-height: 1.5em;
    text-align: center;
    font-weight: bold;
    padding: 10px;
    border-radius: 10px;
    animation: fadeIn 0.5s ease-in-out;
    display: none;
    transform: translateZ(20px);
}

/* Responsive design */
@media (max-width: 768px) {
    .game-title, .categories-title {
        font-size: 2.2rem;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        border-radius: 15px;
    }
    
    .stat-item {
        justify-content: space-between;
    }
    
    .word-display {
        font-size: 1.8rem;
        letter-spacing: 0.3em;
    }
}

@media (max-width: 480px) {
    .game-title, .categories-title {
        font-size: 2rem;
    }
    
    .word-display {
        font-size: 1.5rem;
        letter-spacing: 0.2em;
    }
    
    .input-area {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
    }
    
    #letter-input {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
}

/* Results Modal Styles */
.results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    perspective: 2000px;
}

.results-content {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-out;
    transform: rotateX(10deg) translateZ(100px);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.results-modal[style*="display: flex"] .results-content {
    transform: rotateX(0) translateZ(0);
}

.results-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #f72585;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateZ(30px);
}

#lose-screen .results-title {
    color: #ef233c;
}

#level-complete-screen .results-title {
    color: #4cc9f0;
    text-shadow: 0 2px 10px rgba(76, 201, 240, 0.5);
}

#final-results-screen .results-title {
    color: #f72585;
    text-shadow: 0 2px 10px rgba(247, 37, 133, 0.5);
}

.results-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 1.3rem;
    transform-style: preserve-3d;
}

#level-complete-screen .results-score {
    flex-direction: column;
    margin: 30px 0;
}

#level-complete-screen .score-value {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 10px;
}

#final-results-screen .results-score {
    margin: 30px 0;
}

.score-label {
    color: white;
    opacity: 0.9;
    transform: translateZ(20px);
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: #4cc9f0;
    transform: translateZ(30px);
    animation: bounce 0.5s ease;
}

#lose-screen .score-value {
    color: #f8961e;
}

#final-results-screen .score-value {
    font-size: 3rem;
    color: #f8961e;
    animation: pulse 1.5s infinite;
}

.results-message {
    font-size: 1.2rem;
    color: white;
    margin: 20px 0;
    line-height: 1.5;
    transform: translateZ(20px);
}

.social-share {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 25px 0;
    transform-style: preserve-3d;
}

.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateZ(20px);
}

.whatsapp {
    background-color: #25D366;
    color: white;
}

.facebook {
    background-color: #1877F2;
    color: white;
}

.twitter {
    background-color: #1DA1F2;
    color: white;
}

.share-btn:hover {
    transform: translateY(-3px) translateZ(30px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.play-again-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    background-color: #f72585;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    transform-style: preserve-3d;
    position: relative;
}

.play-again-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    transform: translateZ(-10px);
    transition: all 0.3s ease;
}

.play-again-btn:hover {
    background-color: #d81159;
    transform: translateY(-2px) translateZ(10px);
}

.play-again-btn:hover:before {
    transform: translateZ(-15px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes bounce {
    0%, 100% { transform: translateZ(30px) translateY(0); }
    50% { transform: translateZ(30px) translateY(-15px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotateZ(0); }
    20% { transform: translateX(-10px) rotateZ(-5deg); }
    40% { transform: translateX(10px) rotateZ(5deg); }
    60% { transform: translateX(-10px) rotateZ(-5deg); }
    80% { transform: translateX(10px) rotateZ(5deg); }
}

@keyframes shakeContainer {
    0%, 100% { transform: rotateX(5deg) translateY(0); }
    20% { transform: rotateX(5deg) translateY(-10px) rotateZ(-2deg); }
    40% { transform: rotateX(5deg) translateY(10px) rotateZ(2deg); }
    60% { transform: rotateX(5deg) translateY(-5px) rotateZ(-1deg); }
    80% { transform: rotateX(5deg) translateY(5px) rotateZ(1deg); }
}

@keyframes bounceLetter {
    0% { transform: translateY(0) rotateX(0) scale(1); }
    50% { transform: translateY(-20px) rotateX(180deg) scale(1.2); }
    100% { transform: translateY(0) rotateX(360deg) scale(1); }
}
.mini-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
    text-align: center;
    min-width: 200px;
}

.mini-popup-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-message {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
}

.mini-score {
    font-size: 1rem;
    margin: 0;
}
#final-results-screen {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#final-results-screen:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#final-results-screen .results-title {
    font-size: 3rem;
    color: #f72585;
    text-shadow: 0 3px 10px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

#final-results-screen .score-value {
    font-size: 4rem;
    color: #4cc9f0;
    font-weight: bold;
    text-shadow: 0 3px 10px rgba(0,0,0,0.3);
    margin: 20px 0;
}
#level-complete-screen .results-message {
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
/* Mute Button Styles */
.mute-button {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.mute-button:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

.mute-button i {
  font-size: 24px;
  color: white;
  transition: all 0.3s ease;
}

.mute-button.muted i {
  color: #ef233c;
}

/* Animation for sound events */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.sound-pulse {
  animation: pulse 0.3s ease;
}