@charset "UTF-8";

/* Basic styling */

* {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #eef2f7;
}

/* Main */

main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#flashcard {
    width: 450px;
    height: 300px;
    transform-style: preserve-3d;
    transition: transform 0.5s ease, opacity 0.2s ease;
    cursor: pointer;
}

#front, #back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2em;
}

#front {
    background: white;
}

#back {
    background: #0078d4;
    color: white;
    transform: rotateY(180deg);
}

#pinyin {
    font-size: 0.5em;
    color: #555;
    margin-top: 0.5em;
}

.flipped {
    transform: rotateY(180deg);
}

.swipe-left {
    transform: translateX(-10%);
    opacity: 0;
}

.swipe-right {
    transform: translateX(10%);
    opacity: 0;
}

/* Controls */

#prev, #next {
    position: absolute;
    top: 125px;
    width: 50px;
    height: 50px;
    border: none;
    cursor: pointer;
    background-color: transparent;
    outline: none;
}

#prev {
    right: 100%;
}

#next {
    left: 100%;
}