.gamesxblock-flashcards {
    font-family: 'Inter', sans-serif;
    padding: 24px;
    background: var(--white, #FFFFFF);
    border-radius: 8px;
    box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.08), 0 8px 48px 0 rgba(0, 0, 0, 0.08);
    display: flex;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    flex-direction: column;
    gap: 24px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gamesxblock-flashcards *,
.gamesxblock-flashcards *::before,
.gamesxblock-flashcards *::after {
    box-sizing: inherit;
}

.flashcards-header {
    margin-bottom: 24px;
}

.flashcards-title {
    color: var(--primary-500, #00262B);
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
    margin: 0;
}

.flashcards-start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 24px;
    text-align: center;
    min-height: 385px;
    width: 100%;
}

.flashcards-start-screen.hidden {
    display: none;
}

.flashcards-start-title {
    color: var(--primary-500, #00262B);
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
}

.flashcards-start-button {
    display: inline-flex;
    padding: 10px 16px;
    justify-content: center;
    gap: 8px;
    align-items: center;
    background: var(--primary-500, #00262B);
    color: var(--white, #FFFFFF);
    font-size: 18px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.flashcards-start-button:hover:not(:disabled) {
    background: var(--primary-600, #001A1D);
}

.flashcards-start-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.flashcards-card-wrapper {
    perspective: 1000px;
    margin-bottom: 24px;
    display: none;
}

.flashcards-card-wrapper.active {
    display: block;
}

.flashcard-block {
    position: relative;
    width: 100%;
    height: 373px;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    height: 100%;
    max-width: 550px;
    margin: 0 auto;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
}

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

.flashcard-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    display: flex;
    flex-direction: column;
    border-radius: 8px;
    border: 2px solid var(--Light-300, #F2F0EF);
    background: #fff;
    transition: opacity 0.3s ease-in-out;
    overflow: hidden;
    cursor: pointer;
}

.flashcard-front {
    z-index: 2;
    transform: rotateY(0deg);
}

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

.flashcard-front-content, .flashcard-back-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: center;
    cursor: pointer;
}

.flashcard-text {
    color: var(--primary-500, #00262B);
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
    text-align: center;
    transition: opacity 0.2s ease-in-out;
}

.image {
    max-height: 200px;
    max-width: 100%;
    object-fit: contain;
    flex-shrink: 0;
    margin: 0 auto 16px auto;
    border-radius: 4px;
    display: block;
}

.flashcard-footer {
    display: none;
    justify-content: space-between;
    align-items: center;
    align-self: stretch;
}

.flashcard-footer.active {
    display: flex;
}

.flashcard-navigation {
    display: flex;
    align-items: center;
    gap: 16px;
}

.flashcard-left-button,
.flashcard-right-button {
    display: flex;
    width: 36px;
    height: 36px;
    padding: 6px;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 50%;
    background: var(--light-300, #F2F0EF);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.flashcard-left-button:hover:not(:disabled),
.flashcard-right-button:hover:not(:disabled) {
    background: var(--light-400, #E1DDDB);
    transform: scale(1.03);
}

.flashcard-left-button:active:not(:disabled),
.flashcard-right-button:active:not(:disabled) {
    transform: scale(0.97);
}

.flashcard-left-button:disabled,
.flashcard-right-button:disabled {
    background: var(--light-200, #F9F8F7);
    opacity: 0.5;
    cursor: not-allowed;
}

.flashcard-left-button:disabled svg,
.flashcard-right-button:disabled svg {
    opacity: 0.5;
}

.flashcard-left-image,
.flashcard-right-image {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    pointer-events: none;
}

.flashcard-navigation-text {
    color: var(--primary-500, #00262B);
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    line-height: normal;
    min-width: 60px;
}

.flashcard-help-wrapper {
    position: relative;
}

.flashcard-help-icon {
    display: flex;
    width: 36px;
    height: 36px;
    padding: 6px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease-in-out;
}

.flashcard-help-icon:hover {
    background: var(--light-300, #F2F0EF);
}

.flashcard-help-icon svg {
    color: var(--primary-500, #00262B);
}

.help-popover {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    border-radius: 4px;
    background: var(--Core-Elm, #00262B);
    color: #fff;
    padding: 4px 8px;
    min-width: 200px;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 1000;
    pointer-events: none;
}

.flashcard-help-wrapper:hover .help-popover {
    opacity: 1;
    visibility: visible;
}

.help-popover-content {
    color: var(--extras-white, #FFF);
    text-align: center;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
}

.help-popover-arrow {
    position: absolute;
    top: 100%;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--primary-500, #00262B);
}