:root {
    --bg: #0d0d10;
    --fg: #fff;
    --muted: #888;
    --accent: #ff4d6d;
    --green: #4ade80;
    --card-radius: 18px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 4px;
}

.app-header h1 {
    font-size: 18px;
    margin: 0;
}

.like-counter {
    font-size: 13px;
    color: var(--muted);
}

.deck {
    flex: 1;
    position: relative;
    margin: 8px 16px 0;
    user-select: none;
}

.loader, .empty {
    color: var(--muted);
    text-align: center;
    padding: 60px 16px;
}

.card {
    position: absolute;
    inset: 0;
    border-radius: var(--card-radius);
    background-color: #222;
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
}

.card .gradient {
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
}

.card .meta {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2;
}

.card .meta h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.card .meta .age {
    font-weight: 400;
    opacity: .8;
}

.card .stamp {
    position: absolute;
    top: 24px;
    padding: 8px 16px;
    border: 4px solid currentColor;
    border-radius: 8px;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .1s;
}

.card .stamp.like  { right: 24px; color: var(--green); transform: rotate(-12deg); }
.card .stamp.nope  { left:  24px; color: var(--accent); transform: rotate(12deg); }

.actions {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 18px 16px calc(18px + var(--safe-bottom));
}

.btn-action {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    background: #1f1f23;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.45);
    transition: transform .1s;
}
.btn-action:active { transform: scale(.94); }
.btn-nope { color: var(--accent); }
.btn-like { color: var(--green); }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 24px;
}
.modal[hidden] { display: none; }

.modal-inner {
    background: #15151a;
    border-radius: 24px;
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(255, 77, 109, .25);
}

.modal-inner h2 {
    margin: 0 0 12px;
    font-size: 28px;
    color: var(--accent);
}

.match-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent);
    margin: 8px auto 16px;
    display: block;
}

#match-subtitle {
    color: #ccc;
    margin: 0 0 20px;
    line-height: 1.4;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 10px;
    background: transparent;
    color: var(--muted);
    border: none;
    cursor: pointer;
    font-size: 14px;
}
