body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #f4f4f4;
}

#category-title {
    margin-bottom: 30px;
    color: #333;
}

/* --- Fixed Ratio and Fill Styles --- */

.flip-card {
    background-color: transparent;
    
    /* Responsive Width: 90vw or max 640px */
    width: 90vw; 
    max-width: 640px; 
    
    perspective: 1000px;
    border: 2px solid #ccc;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    cursor: pointer;

    /* ASPECT RATIO: 4:3 (480/640 = 75%) */
    height: 0; 
    padding-bottom: 75%; 
    position: relative;
}

.flip-card-inner {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

.flip-card-front {
    background-color: #fff;
}

.flip-card-back {
    background-color: #333;
    color: white;
    transform: rotateY(180deg);
    flex-direction: column;
    justify-content: space-evenly;
    text-align: center;
}

#image {
    width: 100%;    
    height: 100%;   
    object-fit: cover; 
    border-radius: 8px;
    transition: opacity 0.5s ease-in-out;
}

#word p {
    margin: 5px 0;
    font-size: 2.5em; /* Main text size */
}

/* --- Dropdown Layout and Spacing --- */

/* Grouping container for dropdowns and toggles */
#controls-and-toggles {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Dropdown Group (Horizontal layout and spacing) */
#dropdown-group {
    display: flex; 
    gap: 15px; /* 15px gap between the two drop down boxes */
    margin-bottom: 15px; /* 15px space below dropdowns */
}

/* Apply shared styles and font size to BOTH selects */
#language-select,
#status-filter {
    padding: 8px;
    border-radius: 5px;
    font-size: 1em; 
    /* Ensure the native dropdown arrow is preserved */
    -webkit-appearance: menulist; 
    -moz-appearance: menulist;
    appearance: menulist;
}


/* --- Toggle Fix: Hide all toggles by default --- */
#hiragana-toggle,
#romanji-toggle,
#pinyin-toggle,
#romanization-toggle {
    display: none;
}

/* --- Button and Select Styles (Remaining) --- */
#image-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#image-container button {
    display: none; 
}

#button-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#button-container button {
    padding: 10px 15px;
    font-size: 1em;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#button-container button:hover {
    background-color: #0056b3;
}

/* Specific styling for the Font Awesome icon inside the button */
#mark-learned i {
    font-size: 1.2em;
    color: #333;
    transition: color 0.3s;
}

/* --- Toggle Styles (Container ensures spacing) --- */
#toggle-container {
    display: flex;
    gap: 15px;
}

#toggle-container div {
    align-items: center;
    gap: 5px;
}