.moment-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.moment-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 8px 12px;
    background: white;
    color: #2f7a45;
    border: 2px solid #cde5d2;
    border-radius: 10px;
    font-size: 15px;
}

.moment-btn.active {
    background: #2f7a45;
    color: white;
    border-color: #2f7a45;
}

.moment-count {
    font-size: 12px;
    font-weight: normal;
    opacity: 0.85;
}

.moment-actions {
    margin-top: 10px;
    display: flex;
    gap: 12px;
}

.link-btn {
    padding: 4px 0;
    background: none;
    color: #2f7a45;
    font-size: 14px;
    font-weight: normal;
    text-decoration: underline;
}

.deck-options {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #444;
}

.deck-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.deck {
    max-width: 560px;
    margin: 10px auto 30px;
}

.deck-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #666;
    font-size: 15px;
}

/* Vändkortet */
.flashcard {
    perspective: 1200px;
    height: 300px;
    cursor: pointer;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

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

.flashcard:hover .flashcard-inner {
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.flashcard:focus-visible .flashcard-inner {
    outline: 3px solid #5b4bb7;
    outline-offset: 4px;
    border-radius: 18px;
}

.flashcard-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 24px;
    border-radius: 18px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.flashcard-front {
    background: white;
    border: 2px solid #d5cff7;
    color: #2d2d2d;
}

.flashcard-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: rotateY(180deg);
}

.flashcard-tag {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 13px;
    font-weight: bold;
    opacity: 0.6;
}

.flashcard-lang {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

.flashcard-text {
    font-size: 2.2em;
    font-weight: bold;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.flashcard-text.long {
    font-size: 1.6em;
}

.flashcard-text.very-long {
    font-size: 1.25em;
}

.flashcard-hint,
.flashcard-prompt {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    font-size: 14px;
    opacity: 0.6;
}

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

.card-controls[hidden] {
    display: none;
}

.nav-btn {
    background: #f0f0f0;
    color: #444;
    padding: 12px 18px;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.flip-btn {
    background: #5b4bb7;
    color: white;
}

.grade-btn {
    flex: 1;
    max-width: 220px;
    color: white;
}

.grade-btn.missed {
    background: #e74c3c;
}

.grade-btn.known {
    background: #27ae60;
}

.keyboard-help {
    margin-top: 14px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.deck-done {
    max-width: 560px;
    margin: 10px auto 30px;
    padding: 30px;
    text-align: center;
    background: #f7f5ff;
    border-radius: 14px;
    color: #444;
    line-height: 1.6;
}

.deck-done h2 {
    margin-top: 0;
}

@media (max-width: 768px) {
    .flashcard {
        height: 260px;
    }

    .flashcard-text {
        font-size: 1.8em;
    }

    .keyboard-help {
        display: none;
    }

    .card-controls .nav-btn {
        padding: 12px 18px;
    }

    .nav-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flashcard-inner {
        transition: none;
    }
}
