:root {
    --primary-color: #FF85A2;
    --secondary-color: #FFB3C6;
    --accent-color: #FF4D6D;
    --background-color: #FFF0F5;
    --text-color: #4A4A4A;
    --card-color: #FFFFFF;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 133, 162, 0.1);
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

h1 {
    font-size: 2rem;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 300px;
    height: 400px;
    margin-bottom: 20px;
    position: relative;
    touch-action: none;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: grab;
}

.flashcard:active {
    cursor: grabbing;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(255, 77, 109, 0.2);
    background-color: var(--card-color);
    overflow: hidden;
    border: 4px solid var(--primary-color);
}

.flashcard-back {
    transform: rotateY(180deg);
}

.flashcard::before, .flashcard::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px dashed var(--secondary-color);
    border-radius: 15px;
    pointer-events: none;
}

.flashcard::after {
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
}

.question, .hint, .answer {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.flashcard.changing .question,
.flashcard.changing .hint,
.flashcard.changing .answer {
    opacity: 0;
    transform: scale(0.8);
}

.question {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.hint {
    font-size: 1rem;
    text-align: center;
    color: var(--text-color);
    margin-top: 20px;
    font-weight: 300;
}

.answer {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: var(--secondary-color);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress {
    width: 0%;
    height: 100%;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

.btn {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(255, 77, 109, 0.2);
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(255, 77, 109, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 77, 109, 0.2);
}

.tables-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
    max-width: 800px;
}

.table {
    background-color: var(--card-color);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(255, 77, 109, 0.1);
}

.table-title {
    font-size: 1.4rem;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.table-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.table-item {
    background-color: var(--secondary-color);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    flex-grow: 1;
}

@media (min-width: 768px) {
    .flashcard-container {
        max-width: 400px;
        height: 500px;
    }

    .question {
        font-size: 2.2rem;
    }

    .answer {
        font-size: 3rem;
    }

    .table-item {
        font-size: 1.1rem;
        padding: 15px;
    }
}