/* ── Erkenntnisse Frontend Learn ── */

.erk {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-text-size-adjust: 100%;
}

/* ── Login Required ── */
.erk-login-required {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.erk-login-required p {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    color: #333;
}

/* ── Header / Category Select ── */
.erk-header {
    margin-bottom: 1rem;
}

.erk-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.erk-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
}

/* ── Stats ── */
.erk-stats {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.erk-stat {
    text-align: center;
    padding: 0.5rem 0.75rem;
    background: #f5f5f5;
    border-radius: 8px;
    min-width: 70px;
}

.erk-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.erk-stat-label {
    font-size: 0.6875rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Progress ── */
.erk-progress {
    text-align: center;
    font-size: 0.8125rem;
    color: #888;
    margin-bottom: 0.5rem;
}

/* ── Card ── */
.erk-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.2s, background 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    outline: none;
}

.erk-card:active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.erk-card.is-flipped {
    background: #fafafa;
}

.erk-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.erk-badge.is-new {
    background: #dff0d8;
    color: #3c763d;
}

.erk-badge.is-review {
    background: #d9edf7;
    color: #31708f;
}

.erk-card-front {
    font-size: 1.25rem;
    line-height: 1.5;
    color: #1d2327;
    white-space: pre-wrap;
    word-break: break-word;
}

.erk-card-back {
    font-size: 1.0625rem;
    line-height: 1.5;
    color: #333;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 2px solid #e0e0e0;
    width: 100%;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Buttons ── */
.erk-actions,
.erk-rating {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.erk-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.erk-btn:active {
    transform: scale(0.96);
}

.erk-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.erk-btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
    width: 100%;
}

.erk-btn-primary {
    background: #2271b1;
    color: #fff;
}

.erk-btn-primary:active {
    background: #135e96;
}

.erk-btn-again {
    background: #d63638;
    color: #fff;
    flex: 1;
    min-width: 0;
}

.erk-btn-again:active {
    background: #b32d2e;
}

.erk-btn-hard {
    background: #dba617;
    color: #fff;
    flex: 1;
    min-width: 0;
}

.erk-btn-hard:active {
    background: #bd8600;
}

.erk-btn-good {
    background: #00a32a;
    color: #fff;
    flex: 1;
    min-width: 0;
}

.erk-btn-good:active {
    background: #008a20;
}

.erk-btn-easy {
    background: #2271b1;
    color: #fff;
    flex: 1;
    min-width: 0;
}

.erk-btn-easy:active {
    background: #135e96;
}

/* ── Session Done ── */
.erk-done {
    text-align: center;
    padding: 2rem 0;
}

.erk-done h2 {
    margin: 0 0 1rem;
    font-size: 1.375rem;
    color: #1d2327;
}

.erk-done-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* ── Loading ── */
.erk-loading {
    text-align: center;
    padding: 3rem 0;
    color: #888;
    font-size: 1rem;
}

[hidden] {
    display: none !important;
}

/* ── Swipe hint ── */
@media (pointer: coarse) {
    .erk-card.is-flipped::after {
        content: '← →';
        position: absolute;
        bottom: 0.5rem;
        right: 0.75rem;
        font-size: 0.6875rem;
        color: #bbb;
        pointer-events: none;
    }
}
