/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app, main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

/* ── Header ── */
h1.app-title {
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 40px;
}

/* ── Card Container ── */
.card-container {
    perspective: 1200px;
    width: min(360px, 90vw);
    height: 220px;
    cursor: pointer;
    margin-bottom: 32px;
}

/* ── Card ── */
.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
    border-radius: 18px;
}

.card.flipped { transform: rotateY(180deg); }

.card-front, .card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    text-align: center;
}

/* Front: deep navy with subtle glass border */
.card-front {
    background: linear-gradient(145deg, #1a1a4e, #2d2b7a);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-front h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #e8e4ff;
}

.category-badge {
    margin-top: 10px;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 3px 12px;
    color: rgba(255,255,255,0.6);
}

.tap-hint {
    position: absolute;
    bottom: 14px;
    font-size: 0.72rem;
    opacity: 0.35;
    letter-spacing: 0.08em;
}

/* Back: warm light with contrast text */
.card-back {
    background: linear-gradient(145deg, #f5f0ff, #e8e0ff);
    transform: rotateY(180deg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card-back p {
    color: #2d2b7a;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
}

/* ── Controls ── */
.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.counter {
    font-size: 0.85rem;
    opacity: 0.5;
    min-width: 60px;
    text-align: center;
    letter-spacing: 0.05em;
}

button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    backdrop-filter: blur(6px);
}

button:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

button:active { transform: translateY(0); }

/* ── Responsive ── */
@media (max-width: 400px) {
    .card-front h2 { font-size: 1.4rem; }
    .card-back p   { font-size: 0.9rem; }
}

/* ── Blazor Error UI ── */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #ffcd56;
    color: #333;
    padding: 10px;
    text-align: center;
    z-index: 1000;
}

