* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: url('assets/img/background.png') no-repeat;
    background-position: center top;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}
.container-custom {
    width: 100%;
    max-width: 900px;
}
.screen {
    display: none;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 30px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-in;
}
.screen.active {
    display: block;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Back Button */
.btn-back {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.back-btn-img {
    width: 100%;
    max-width: 150px;
    height: auto;
    object-fit: contain;
}
.btn-back:hover {
    transform: translateY(-5px) scale(1.05);
}

.btn-back:active {
    transform: translateY(0) scale(0.98);
}
@media (max-width: 576px) {
    .back-btn-img {
        max-width: 120px;
    }
}

/* FULLSCREEN PRELOADER */
#preloader {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.hidden {
  display: none;
}
.loader {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 6rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}
.loader:before,
.loader:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  animation: pulsOut 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 1rem rgba(255, 255, 255, 0.75));
}
.loader:before {
  width: 100%;
  padding-bottom: 100%;
  box-shadow: inset 0 0 0 1rem #d1bf66;
  animation-name: pulsIn;
}
.loader:after {
  width: calc(100% - 2rem);
  padding-bottom: calc(100% - 2rem);
  box-shadow: 0 0 0 0 #d1bf66;
}
@keyframes pulsIn {
  0% {
    box-shadow: inset 0 0 0 1rem #d1bf66;
    opacity: 1;
  }
  50%, 100% {
    box-shadow: inset 0 0 0 0 #d1bf66;
    opacity: 0;
  }
}
@keyframes pulsOut {
  0%, 50% {
    box-shadow: 0 0 0 0 #d1bf66;
    opacity: 0;
  }
  100% {
    box-shadow: 0 0 0 1rem #d1bf66;
    opacity: 1;
  }
}


/* Start Menu */
#startScreen {
    background: none;
    backdrop-filter: unset;
    box-shadow: none;
}
#startScreen .logo {
    text-align: center;
    margin-bottom: 10rem;
}
.logo-img {
    width: clamp(250px, 70vw, 800px);
    height: auto;
    margin: 0 auto 5rem auto;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
}
.play-btn {
    max-width: 100%;
    width: clamp(150px, 40vw, 250px);
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite 1.5s;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
}
.play-btn:hover {
    transform: scale(1.1) translateY(-10px);
    filter: drop-shadow(0 15px 35px rgba(200, 200, 200, 0.8));
}
.play-btn:active {
    transform: scale(1.05) translateY(-5px);
}
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Topic Menu */
.topic-title {
    text-align: center;
    font-size: clamp(32px, 6vw, 42px);
    color: #667eea;
    margin-bottom: 30px;
    font-weight: bold;
}
.topic-btn {
    width: 100%;
    padding: 20px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #667eea;
}
.topic-btn:hover {
    transform: translateY(-10px);
    color: #d1bf66;
}
.topic-img {
    width: 100%;
    max-width: 150px;
    height: auto;
    object-fit: contain;
}
.topic-text {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: bold;
    
    text-transform: capitalize;
}
@media (max-width: 767px) {
    .topic-img {
        max-width: 120px;
    }
}

/* Player Setup */
.player-count-section {
    text-align: center;
    margin-bottom: 30px;
}
.player-count-section h3 {
    color: #667eea;
    font-size: clamp(18px, 4vw, 24px);
    margin-bottom: 15px;
}
.count-btn {
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.count-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.count-btn:hover:not(:disabled) {
    transform: scale(1.15);
}
.count-btn:active:not(:disabled) {
    transform: scale(0.95);
}
.count-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.count-display {
    font-size: clamp(36px, 8vw, 48px);
    font-weight: bold;
    color: #667eea;
    margin: 0 25px;
    min-width: 60px;
}
.btn-start {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    margin-top: 2rem;
}
.start-btn-img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
}
.btn-start:hover {
    transform: translateY(-5px) scale(1.05);
}
.btn-start:active {
    transform: translateY(0) scale(0.98);
}
#playerScreen .container {
    min-height: 250px;
}
.player-label {
    font-size: clamp(16px, 3vw, 20px);
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}
.player-input {
    width: 100%;
    padding: 12px 20px;
    border: 3px solid #667eea;
    border-radius: 15px;
    font-size: clamp(16px, 3vw, 18px);
    outline: none;
    transition: all 0.3s;
}
.player-input:focus {
    border-color: #d1bf66;
    box-shadow: 0 0 15px rgba(252, 248, 213, 0.3);
}
@media (max-width: 576px) {
    .count-btn {
        width: 50px;
        height: 50px;
    } 
    .count-display {
        margin: 0 15px;
    }
}

/* Gameplay */
.player-card {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #71b3c7 100%);
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    margin-bottom: 15px;
}
.player-card.active {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    background: linear-gradient(
        -45deg, 
        #a87331,
        #d1bf66,
        #e8c379
    );
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
.player-card.eliminated {
    opacity: 0.4;
    filter: grayscale(100%);
}
.player-number {
    font-size: clamp(14px, 3vw, 18px);
    color: white;
    font-weight: bold;
    margin-bottom: 5px;
}
.player-name {
    font-size: clamp(18px, 4vw, 22px);
    color: white;
    font-weight: bold;
    margin-bottom: 12px;
}
.hearts {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.heart {
    width: 25px;
    height: 25px;
    background: url('assets/img/heart.png') center/contain no-repeat;
}
.heart.lost {
    opacity: 0.2;
    filter: grayscale(100%);
}
.game-content {
    text-align: center;
}
.instruction {
    font-size: clamp(18px, 4vw, 24px);
    color: #667eea;
    margin-bottom: 25px;
    font-weight: bold;
}
.game-input-wrapper {
    margin-bottom: 30px;
}
.game-input {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    border: 4px solid #667eea;
    border-radius: 20px;
    font-size: clamp(18px, 4vw, 24px);
    text-align: center;
    outline: none;
    transition: all 0.3s;
}
.game-input:focus {
    border-color: #d1bf66;
    box-shadow: 0 0 15px rgba(252, 248, 213, 0.3);
}
.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.play-audio-btn {
    width: clamp(70px, 15vw, 100px);
    height: clamp(70px, 15vw, 100px);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.audio-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.play-audio-btn:hover {
    transform: scale(1.15);
}
.play-audio-btn:active {
    transform: scale(0.95);
}
.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f0f0f0;
    padding: 12px 20px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}
.timer-icon {
    width: clamp(30px, 6vw, 40px);
    height: clamp(30px, 6vw, 40px);
    object-fit: contain;
}
#timerValue {
    font-size: clamp(28px, 6vw, 36px);
    font-weight: bold;
    color: #667eea;
    min-width: 45px;
    text-align: center;
}
.submit-btn {
    width: clamp(80px, 20vw, 120px);
    height: clamp(80px, 20vw, 120px);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.enter-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.submit-btn:hover {
    transform: scale(1.15);
}
.submit-btn:active {
    transform: scale(0.95);
}
.feedback {
    margin-top: 20px;
    font-size: clamp(18px, 4vw, 24px);
    font-weight: bold;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feedback.correct {
    color: #43e97b;
}
.feedback.wrong {
    color: #f5576c;
}

@media (max-width: 576px) {
    .game-controls {
        gap: 15px;
    }
    
    .timer-display {
        padding: 10px 15px;
    }
    
    #timerValue {
        min-width: 35px;
    }
}

/* Game Over */
.game-over-content {
    text-align: center;
}
.game-over-title {
    font-size: clamp(36px, 8vw, 52px);
    color: #667eea;
    margin-bottom: 30px;
    font-weight: bold;
}
.winner-info {
    font-size: clamp(24px, 5vw, 32px);
    color: #d1bf66;
    margin-bottom: 20px;
    font-weight: bold;
}
.score-info {
    font-size: clamp(18px, 4vw, 24px);
    color: #666;
    margin-bottom: 40px;
}
@media (max-width: 576px) {
    .screen {
        padding: 25px 15px;
        border-radius: 20px;
    }
    .logo {
        margin-bottom: 30px;
    }
    .player-card {
        padding: 12px;
    }
    .heart {
        width: 20px;
        height: 20px;
    }
}