* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Jua', sans-serif; /* Child-friendly font */
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    text-align: center;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: flex;
}

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

.title {
    font-size: 3rem;
    color: #fff;
    text-shadow: 2px 4px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

.primary-btn {
    background: linear-gradient(45deg, #ff758c 0%, #ff7eb3 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 2rem;
    font-family: 'Jua', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 117, 140, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.primary-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 25px rgba(255, 117, 140, 0.6);
}

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

/* Header & Progress */
.header {
    width: 100%;
    margin-bottom: 20px;
}

#round-info {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.progress-container {
    width: 100%;
    height: 15px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    width: 0%;
    transition: width 0.4s ease;
}

/* Battle Arena */
.battle-arena {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    position: relative;
    gap: 20px;
}

@media (max-width: 768px) {
    .battle-arena {
        flex-direction: column;
    }
}

.logo-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 30px;
    width: 45%;
    max-width: 400px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .logo-card {
        width: 80%;
        margin-bottom: 15px;
    }
}

.logo-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.logo-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.9);
}

.logo-card:active {
    transform: scale(0.95);
}

.logo-card img {
    width: 100%;
    height: 100%;
    max-height: 250px;
    object-fit: contain;
    transition: transform 0.5s ease;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.logo-card:hover img {
    transform: scale(1.1);
}

.brand-name {
    margin-top: 15px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.vs-badge {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(253, 160, 133, 0.4);
    z-index: 10;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(253, 160, 133, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(253, 160, 133, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(253, 160, 133, 0); }
}

/* Result Screen & Share Card */
.share-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    color: #333;
    text-align: center;
}

.winner-display {
    padding-bottom: 20px;
    border-bottom: 2px dashed #eee;
    margin-bottom: 20px;
}

.winner-display img {
    max-width: 180px;
    margin: 0 auto 15px auto;
    display: block;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.winner-subtitle {
    font-size: 1.2rem;
    color: #777;
    margin: 0;
}

.result-analysis {
    margin-bottom: 20px;
}

.main-type {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.type-emoji {
    font-size: 2.5rem;
}

.type-title {
    font-size: 2rem;
    color: #ff3366;
    margin: 0;
}

.type-desc {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
    word-break: keep-all;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.badge-item {
    background: #fdf0f4;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #d81b60;
    border: 1px solid #f8bbd0;
}

.sub-comment {
    font-size: 1rem;
    color: #888;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    font-style: italic;
    word-break: keep-all;
}

.share-footer {
    background: #ff758c;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.share-footer p {
    margin: 0;
    font-size: 1.1rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.secondary-btn {
    background: #fff;
    color: #ff758c;
    border: 2px solid #ff758c;
    padding: 15px 30px;
    font-size: 1.5rem;
    font-family: 'Jua', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #fff0f3;
    transform: scale(1.05);
}

/* Deck Area */
.deck-area {
    margin-top: 30px;
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.05);
}

.deck-title {
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.deck-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    min-height: 60px;
}

.mini-card {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    animation: dropIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.mini-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes dropIn {
    0% { transform: translateY(-100px) scale(2); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes flyToCenter {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-150px) scale(1.5); opacity: 1; }
    100% { transform: translateY(-150px) scale(0); opacity: 0; }
}

.flying-out {
    animation: flyToCenter 1s ease-in-out forwards !important;
}

/* Selection Animations */
.selected-card {
    animation: selectedAnim 0.6s ease forwards !important;
    z-index: 100;
}
@keyframes selectedAnim {
    0% { transform: scale(1); }
    40% { transform: scale(1.15) rotate(5deg); box-shadow: 0 30px 60px rgba(0,0,0,0.2); opacity: 1;}
    100% { transform: scale(0); opacity: 0; }
}

.unselected-card {
    animation: unselectedAnim 0.4s ease forwards !important;
}
@keyframes unselectedAnim {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}
