/* РЕЖИМ СВАЙП: ULTRA PREMIUM IMMERSIVE UX */
#swipe-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    background: radial-gradient(circle at top, #1c1c1e 0%, #000 100%);
    z-index: 999999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

#swipe-view.active {
    display: flex;
}

/* Header */
.sw-header {
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 15px;
    position: relative;
    z-index: 10;
}

.sw-stat-pill {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 18px;
    border-radius: 40px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.sw-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 0.95rem;
}

.sw-ok { color: #32d74b; }
.sw-err { color: #ff453a; }

.sw-progress-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.08);
    padding: 4px 12px;
    border-radius: 20px;
}

.sw-streak-badge {
    position: absolute;
    bottom: -15px;
    font-size: 0.9rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff9500, #ffcc00);
    color: #000;
    padding: 4px 12px;
    border-radius: 12px;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.4);
    z-index: 100;
}

.sw-streak-badge.visible { transform: scale(1); }
.sw-streak-badge.fire {
    background: linear-gradient(135deg, #ff3b30, #ff9500);
    color: #fff;
    box-shadow: 0 0 25px rgba(255, 59, 48, 0.7);
}

/* Card Stack */
.sw-card-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 25px;
    perspective: 1200px;
}

.sw-card {
    position: absolute;
    width: 100%;
    max-width: 350px;
    height: 100%;
    max-height: 520px;
    background: #1c1c1e;
    border-radius: 42px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 70px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.sw-depth-1 {
    transform: translateY(15px) scale(0.93);
    opacity: 0.3;
    z-index: -1;
}

.sw-feedback-correct { border-color: rgba(50, 215, 75, 0.6); box-shadow: 0 0 50px rgba(50, 215, 75, 0.3); }
.sw-feedback-wrong { border-color: rgba(255, 69, 58, 0.6); box-shadow: 0 0 50px rgba(255, 69, 58, 0.3); }

.sw-image-area {
    height: 48%;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sw-image-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: radial-gradient(circle, #2c2c2e 0%, #000 100%);
}

.sw-text-area {
    flex: 1;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(to bottom, #1c1c1e, #111);
}

.sw-card.text-only {
    justify-content: center;
}

.sw-card.text-only .sw-text-area {
    padding: 40px;
    height: 100%;
}

.sw-card.text-only .sw-question {
    font-size: 1.5rem;
    font-weight: 700;
}

.sw-card.text-only .sw-stamp {
    top: 20%;
}

.sw-stamp {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 24px;
    border: 6px solid;
    border-radius: 16px;
    font-size: 2.8rem;
    font-weight: 900;
    text-transform: uppercase;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
}
.sw-stamp.yes { right: 25px; color: #32d74b; border-color: #32d74b; transform: translateY(-50%) rotate(12deg); }
.sw-stamp.no { left: 25px; color: #ff453a; border-color: #ff453a; transform: translateY(-50%) rotate(-12deg); }

/* Footer Controls */
.sw-footer {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: env(safe-area-inset-bottom, 30px);
}

.sw-footer-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 360px;
    padding: 0 25px;
}

.sw-ctrl {
    height: 62px;
    border-radius: 20px;
    border: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.sw-ctrl i { font-size: 1.1rem; }
.sw-ctrl span { font-size: 0.95rem; font-weight: 900; letter-spacing: 0.5px; }

.sw-ctrl-no {
    flex: 2.5;
    background: linear-gradient(135deg, #ff453a, #ff3b30);
    color: #fff;
}

.sw-ctrl-yes {
    flex: 2.5;
    background: linear-gradient(135deg, #32d74b, #28cd41);
    color: #fff;
}

.sw-ctrl-finish {
    width: 62px;
    flex: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255,255,255,0.06);
}

.sw-ctrl:active { transform: scale(0.9); filter: brightness(1.2); }
.sw-ctrl-finish:active { background: rgba(255,255,255,0.15); color: #fff; }

/* RESULTS VIEW: MODULAR & LINEAR */
.sw-res-view.immersive {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, #1c1c1e 0%, #000 100%);
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 40px);
    z-index: 1000;
}

.sw-res-header {
    text-align: center;
    padding: 20px;
}

.sw-res-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
}

.sw-res-body.scroll-fade {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 40px;
    mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
}

.sw-res-content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sw-res-section {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 28px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sw-res-section.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    padding: 10px 0;
}

.sw-res-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    padding-left: 5px;
}

.sw-score-box {
    position: relative;
    display: flex;
    justify-content: center;
}

.sw-score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 8px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
}

.sw-score-box.perfect .sw-score-circle { border-color: #32d74b; color: #32d74b; }
.sw-score-box.good .sw-score-circle { border-color: #ff9500; color: #ff9500; }
.sw-score-box.bad .sw-score-circle { border-color: #ff453a; color: #ff453a; }

.sw-score-num { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.sw-score-label { font-size: 0.75rem; font-weight: 700; opacity: 0.6; margin-top: 5px; text-transform: uppercase; letter-spacing: 1px; }

.sw-res-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sw-grid-item {
    background: rgba(255,255,255,0.05);
    padding: 18px 5px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.03);
}

.sw-grid-label { font-size: 0.65rem; font-weight: 700; opacity: 0.4; margin-bottom: 8px; text-transform: uppercase; }
.sw-grid-val { font-size: 1.1rem; font-weight: 900; }
.sw-grid-val.ok { color: #32d74b; }
.sw-grid-val.err { color: #ff453a; }
.sw-grid-val.bonus { color: #ff9500; }

.sw-res-mistakes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sw-res-mistake-card {
    background: rgba(255,255,255,0.04);
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    text-align: left;
    transition: transform 0.2s, background 0.2s;
}

.sw-res-mistake-card.clickable:active {
    transform: scale(0.97);
    background: rgba(255,255,255,0.08);
}

.sw-res-q-text {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f2f2f7;
    line-height: 1.4;
}

.sw-res-a-text {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
}

.sw-res-a-text span {
    color: #32d74b;
    font-weight: 700;
}

@media (max-height: 700px) {
    .sw-header { height: 110px; }
    .sw-res-content { gap: 15px; }
    .sw-score-circle { width: 120px; height: 120px; }
    .sw-res-section { padding: 20px; }
}

@media (max-height: 600px) {
    .sw-header { height: 90px; }
    .sw-res-header { padding: 10px 20px; }
    .sw-res-title { font-size: 1.4rem; }
}
