:root {
    --primary-blue: #008cce;
    --text-black: #000000;
    --text-grey: #666666;
    --bg-white: #ffffff;
    --correct-green: #2ecc71;
    --incorrect-red: #e74c3c;
    --btn-a: #669933;
    --btn-an: #fbb03b;
    --font-outfit: 'Outfit', sans-serif;
    --font-opensans: 'Open Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-white);
    font-family: var(--font-outfit);
    user-select: none;
    -webkit-user-select: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s ease;
}

.hidden-state {
    display: none !important;
}

#splash-screen {
    z-index: 10;
    cursor: pointer;
}

#main-screen {
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    justify-content: flex-start;
}

#main-screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Splash Content */
.splash-content {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#main-logo {
    width: 250px;
    height: auto;
    margin-bottom: 20px;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 2s ease-in-out;
    will-change: transform, opacity;
}

#tap-text {
    font-size: 1.5rem;
    color: var(--primary-blue);
    font-weight: 700;
    letter-spacing: 1px;
}

/* Main Header */
.main-header {
    text-align: center;
    transition: transform 1s ease-in-out, top 1s ease-in-out;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.main-header.at-top {
    top: 60px;
    transform: translate(-50%, 0);
}

.unit-title {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: -5px;
}

.subtheme-title {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-weight: 400;
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 145px;
    opacity: 0;
    transition: opacity 1.5s ease;
    width: 100%;
}

.main-content.visible {
    opacity: 1;
}

.medium-logo {
    width: 140px;
    height: auto;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.game-button {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-family: var(--font-opensans);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 140, 206, 0.3);
    transition: transform 0.2s ease;
}

.game-button:active {
    transform: scale(0.95);
}

.practice-button {
    background-color: #fbb03b;
    width: 160px; /* Ancho fijo para asegurar que sea más angosto */
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 15px rgba(251, 176, 59, 0.3);
}

.instructions-container {
    text-align: center;
    width: 100%;
    margin-top: 15px;
}

.instruction-label {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-size: 0.95rem;
    font-weight: 700;
}

.instruction-body {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-size: 0.95rem;
}

/* Activity Screens Styles */
#practice-screen, #game-screen, #practice-finish-screen, #game-finish-screen {
    background-color: white;
    padding: 20px;
    z-index: 20;
}

.activity-top-bar {
    position: absolute;
    top: 30px;
    width: 100%;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.round-counter-left {
    font-family: var(--font-opensans);
    font-weight: 700;
    color: var(--text-grey);
    font-size: 1rem;
    margin: 0;
}

.sound-control {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-opensans);
    font-size: 0.9rem;
    color: var(--text-grey);
    font-weight: 700;
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-blue);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-blue);
}

input:checked + .slider:before {
  -webkit-transform: translateX(20px);
  -ms-transform: translateX(20px);
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.activity-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 100%;
}

.asset-display.no-frame {
    width: 220px;
    height: 250px; /* Increased height to accommodate text */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    position: relative;
    overflow: visible;
}

.game-image {
    max-width: 100%;
    max-height: 180px; /* Adjusted to leave space for text */
    object-fit: contain;
}

.asset-name {
    color: var(--text-black);
    font-family: var(--font-opensans);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2px; /* Muy pegado */
}

.feedback-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-opensans);
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 20px;
}

.feedback-overlay.correct {
    background-color: rgba(102, 153, 51, 0.9);
    opacity: 1;
}

.feedback-overlay.incorrect {
    background-color: rgba(231, 76, 60, 0.9);
    opacity: 1;
}

.choice-buttons {
    display: flex;
    gap: 20px;
}

.choice-btn {
    width: 120px;
    border: none;
    color: white;
    padding: 12px 0;
    border-radius: 15px;
    font-family: var(--font-opensans);
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.choice-btn.btn-a {
    background-color: var(--btn-a);
}

.choice-btn.btn-an {
    background-color: var(--btn-an);
}

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

.btn-repeat {
    background-color: var(--primary-blue) !important;
    color: white !important;
    padding: 12px 30px !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 10px rgba(0, 140, 206, 0.2);
}

.utility-btn {
    border: none;
    font-family: var(--font-opensans);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.activity-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 80px;
}

.exit-btn-styled {
    background-color: var(--text-grey);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 50px;
    font-family: var(--font-opensans);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(102, 102, 102, 0.2);
    transition: transform 0.2s ease;
}

.exit-btn-styled:active {
    transform: scale(0.95);
}

.activity-info-bottom {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-size: 0.9rem;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
}

/* Redesigned Finish Screen */
.finish-content-redesign {
    text-align: center;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.score-top-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.finish-logo {
    width: 120px;
    height: auto;
}

.final-score-label {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-size: 1.2rem;
    font-weight: 700;
}

.final-score-value {
    font-family: var(--font-outfit);
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-top: -10px;
}

.whatsapp-info {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-size: 1rem;
    max-width: 280px;
    line-height: 1.4;
}

.min-score-requirement {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-size: 1.1rem;
    font-weight: 700;
}

.play-again-btn {
    background-color: #669933;
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    font-family: var(--font-opensans);
    font-size: 1.2rem;
    font-weight: 400;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 153, 51, 0.3);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-again-btn span {
    font-size: 1.5rem;
}

.play-again-btn:active {
    transform: scale(0.95);
}

/* Animations */
.pulse {
    animation: pulse-animation 2s infinite ease-in-out;
}

.pulse-soft {
    animation: pulse-soft-animation 3s infinite ease-in-out;
}

@keyframes pulse-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulse-soft-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.fade-out {
    opacity: 0 !important;
}

.hidden {
    display: none !important;
}

/* Footer - Persistent */
.persistent-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    padding-bottom: 30px;
    text-align: center;
    width: 100%;
    background-color: transparent;
    z-index: 100;
    pointer-events: none;
}

.powered-by {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-size: 0.8rem;
    margin-bottom: -5px;
    font-weight: 700;
}

.footer-brand {
    position: relative;
    display: inline-block;
}

.footer-logo {
    height: 16px;
    width: auto;
    position: absolute;
    right: 100%;
    margin-right: 8px;
    top: 50%;
    transform: translateY(-50%);
}
/* Unit Info Styles */
.unit-info-footer {
    text-align: center;
    margin-bottom: 10px;
}

.unit-title-small {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-weight: 700;
    font-size: 0.9rem;
}

.subtheme-title-small {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-weight: 400;
    font-size: 0.75rem;
}

.unit-info-header {
    text-align: center;
    margin-bottom: 5px;
}

.unit-title-finish {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-weight: 700;
    font-size: 1.8rem;
}

.subtheme-title-finish {
    font-family: var(--font-opensans);
    color: var(--text-grey);
    font-weight: 400;
    font-size: 1rem;
}

.finish-text-redesign {
    font-family: var(--font-opensans);
    color: var(--text-black);
    font-size: 1rem;
    max-width: 300px;
    line-height: 1.4;
}

.green-btn {
    background-color: #669933 !important;
    font-weight: 400 !important;
    box-shadow: 0 4px 15px rgba(102, 153, 51, 0.3) !important;
}

.fade-in-finish.active {
    transition: opacity 2.5s ease !important;
}

.footer-brand span {
    font-family: var(--font-opensans);
    font-size: 0.85rem;
    color: var(--text-grey);
    font-weight: 400;
}
