
/* === SPLASH LOADER === */
#splash-screen {
    background-color: #111827; /* bg-gray-900 */
    opacity: 1;
    transition: opacity 0.5s ease-out;
}
.loader {
    display: block;
    position: relative;
    height: 12px;
    width: 80%;
    max-width: 400px;
    border: 2px solid #C4B5FD; 
    border-radius: 10px;
    overflow: hidden;
}
.loader:after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: #7C3AED; 
    animation: 2s prog ease-out 1;
    animation-fill-mode: forwards; 
}

@keyframes prog {
    to { width: 100%; }
}

/* === COUNTDOWN OVERLAY === */
#countdown-overlay {
    background-color: rgba(0, 0, 0, 0.85); /* Dark overlay */
    backdrop-filter: blur(5px);
}

.countdown-animate {
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop-in {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}


/* Custom font and base styles */
body { 
    font-family: 'Nunito', sans-serif; 
    background-color: #EDE9FE; 
    --success-color: #10B981;
    --success-color-light: #10b98180; /* 50% opacity */
    --error-color: #DC2626;
    --error-color-light: #dc262680; /* 50% opacity */
}
.game-card {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

/* Pulse animation for feedback and timer */
@keyframes pulse-success { 
    0% { transform: scale(1); box-shadow: 0 0 0 0px var(--success-color-light); }
    50% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(0,0,0,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0px rgba(0,0,0,0); } 
}
@keyframes pulse-error { 
    0% { transform: scale(1); box-shadow: 0 0 0 0px var(--error-color-light); } 
    50% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(0,0,0,0); } 
    100% { transform: scale(1); box-shadow: 0 0 0 0px rgba(0,0,0,0); } 
}
.feedback-success { 
    animation: pulse-success 1s ease-in-out infinite; 
}
.feedback-error { 
    animation: pulse-error 1s ease-in-out infinite; 
}

/* === SMILEY BUTTON STYLES === */
.smiley-btn {
    position: relative; 
    overflow: hidden; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; 
}
.smiley-btn-face {
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.smiley-btn-hover {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 10; 
}
.smiley-btn-hover-left { left: 0; }
.smiley-btn-hover-right { right: 0; }

.smiley-btn:hover .smiley-btn-face {
    transform: translateY(-2px) scale(1.3);
}
.smiley-btn .smiley-btn-hover-left:hover ~ .smiley-btn-face {
    transform: translateX(-3px) rotate(-18deg) scale(1.3);
}
.smiley-btn .smiley-btn-hover-right:hover ~ .smiley-btn-face {
    transform: translateX(3px) rotate(18deg) scale(1.3);
}

/* === 3D BUTTON STYLES === */
.btn-3d {
    --btn-bg: #1899D6; /* Default blue */
    --btn-shadow: #1CB0F6; /* Default light blue */

    appearance: button;
    background-color: var(--btn-bg);
    border: solid transparent;
    border-radius: 16px;
    border-width: 0 0 4px;
    box-sizing: border-box;
    color: #FFFFFF; /* Default text white */
    cursor: pointer;
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .8px;
    line-height: 20px;
    margin: 0;
    outline: none;
    overflow: visible;
    padding: 13px 19px;
    text-align: center;
    text-transform: uppercase;
    touch-action: manipulation;
    transform: translateZ(0);
    transition: filter .2s;
    user-select: none;
    -webkit-user-select: none;
    vertical-align: middle;
    white-space: nowrap;
    position: relative; 
    z-index: 1; 
}

.btn-3d:after {
    background-clip: padding-box;
    background-color: var(--btn-shadow);
    border: solid transparent;
    border-radius: 16px;
    border-width: 0 0 4px;
    bottom: -4px;
    content: "";
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: -1;
}

.btn-3d:focus {
    user-select: auto;
}

.btn-3d:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-3d:disabled {
    cursor: auto;
    filter: brightness(0.7) opacity(0.8);
}

.btn-3d:active:after {
    border-width: 0 0 0px;
}

.btn-3d:active {
    padding-bottom: 10px; 
    padding-top: 16px; 
}

/* Color Helpers */
.btn-purple { --btn-bg: #7C3AED; --btn-shadow: #985EFF; }
.btn-green { --btn-bg: #10B981; --btn-shadow: #14e09e; }
.btn-orange { --btn-bg: #F97316; --btn-shadow: #fa8e42; }
.btn-red { --btn-bg: #DC2626; --btn-shadow: #e94d4d; }
.btn-yellow { --btn-bg: #FBBF24; --btn-shadow: #fcd256; }
.btn-easy-green { --btn-bg: #6EE7B7; --btn-shadow: #8ef0c9; }
.btn-gray { --btn-bg: #6B7280; --btn-shadow: #868d9a; }
.btn-blue { --btn-bg: #3B82F6; --btn-shadow: #60A5FA; } /* Added Blue */

/* Text Color Helper */
.btn-dark-text {
    color: #1F2937; 
}

/* Size Helper */
.btn-small {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 12px;
    line-height: 1.2; 
}
.btn-small:after {
    border-radius: 12px;
}
.btn-small:active {
    padding-bottom: 5px;
    padding-top: 11px;
}

/* Daily Challenge Input */
#daily-input {
    appearance: none;
    border: 3px solid #D1D5DB; 
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1.25rem; 
    font-weight: 600; 
    text-align: center;
    width: 100%;
    outline: none;
    transition: all 0.2s ease-in-out;
    letter-spacing: 0.1em; 
    text-transform: uppercase; 
}
#daily-input::placeholder {
    color: #9CA3AF; 
    text-transform: none;
    letter-spacing: normal;
}
#daily-input:focus {
    border-color: #7C3AED; 
    box-shadow: 0 0 0 3px #7c3aed40; 
}

/* Animations */
@keyframes jelly {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15) rotate(-2deg); }
  50% { transform: scale(0.9) rotate(2deg); }
  75% { transform: scale(1.1) rotate(-1deg); }
}
.jelly-animation {
  animation: jelly 0.6s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.shake-animation {
  animation: shake 0.5s ease-in-out;
}

@keyframes pulse-invite {
  0%, 100% { 
    transform: scale(1); 
    filter: brightness(1.1); 
  }
  50% { 
    transform: scale(1.05); 
    filter: brightness(1.25); 
  }
}
.pulse-invite-animation {
  animation: pulse-invite 1.5s ease-in-out infinite; 
}

@keyframes jiggle {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.25) rotate(5deg); }
  70% { transform: scale(0.9) rotate(-3deg); }
}
.jiggle-animation {
  animation: jiggle 0.5s ease-out;
}

/* Settings buttons */
.setting-btn {
    transition: all 0.2s ease;
    border: 2px solid #D1D5DB; 
}
.setting-btn.selected {
    background-color: #7C3AED; 
    color: white;
    border-color: #7C3AED;
    font-weight: 700;
}
.setting-btn:not(.selected):hover {
    background-color: #F3F4F6; 
}

/* Transitions */
@keyframes fade-out-fast {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}
.animate-fade-out {
  animation: fade-out-fast 0.2s ease-out forwards;
}

@keyframes scale-in-fast {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.animate-scale-in {
  animation: scale-in-fast 0.3s ease-in-out forwards;
}

/* Card Bounce */
@keyframes card-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.card-bounce-animation {
    animation: card-bounce 0.3s ease-out;
}

/* Confetti */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
    overflow: hidden;
    z-index: 1000;
}
.confetti {
    position: absolute;
    width: 8px;
    height: 16px;
    opacity: 0;
    animation: confetti-fall 3s ease-out forwards, confetti-rotate 3s linear infinite;
}
@keyframes confetti-fall {
    0% { top: -10%; opacity: 1; transform: translateY(0); }
    100% { top: 110%; opacity: 1; transform: translateY(100vh); }
}
@keyframes confetti-rotate {
    0% { transform: rotateZ(0deg); }
    100% { transform: rotateZ(360deg); }
}

/* Review Session Styles */
.filter-btn {
    transition: all 0.2s ease;
    border: 2px solid #D1D5DB; 
    padding: 6px 12px;
    font-size: 0.875rem; 
    font-weight: 600; 
    border-radius: 8px;
}
.filter-btn.selected {
    background-color: #7C3AED; 
    color: white;
    border-color: #7C3AED;
}
.filter-btn:not(.selected):hover {
    background-color: #F3F4F6; 
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #E5E7EB; 
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #9CA3AF; 
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #6B7280; 
}