:root {
    color-scheme: dark;
    --bg: #111012;
    --panel: #1c181d;
    --panel-strong: #261d25;
    --text: #fff7fb;
    --muted: #bbaab4;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #ff315f;
    --accent-hot: #ff7a45;
    --danger: #ff8aa4;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 49, 95, 0.25), transparent 36rem),
        linear-gradient(135deg, #111012 0%, #21141d 52%, #111012 100%);
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
}

.ghost-link {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}

.page {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    align-content: center;
    gap: 28px;
}

.brand {
    text-align: center;
}

.logo {
    font-size: 54px;
    line-height: 1;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    margin-top: 8px;
    font-size: 44px;
    line-height: 1;
}

h2 {
    font-size: 23px;
}

h3 {
    font-size: 20px;
    line-height: 1.2;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}

.topbar p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 17px;
}

.section {
    margin-top: 28px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(28, 24, 29, 0.88);
    box-shadow: var(--shadow);
}

.login-card {
    display: grid;
    gap: 14px;
    padding: 22px;
}

label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

input {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0 18px;
    color: var(--text);
    background: #141114;
    font-size: 24px;
    outline: none;
}

input:focus {
    border-color: rgba(255, 49, 95, 0.85);
    box-shadow: 0 0 0 4px rgba(255, 49, 95, 0.14);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.preset-grid form,
.section-head form {
    margin: 0;
}

.preset-button,
.random-button,
.primary-button,
.ghost-button {
    min-height: 48px;
    border-radius: 16px;
    color: var(--text);
    font-weight: 800;
    transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.preset-button:hover,
.random-button:hover,
.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.preset-button {
    display: flex;
    width: 100%;
    min-height: 70px;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg, #2a2028, #171317);
    text-align: left;
}

.preset-button span {
    font-size: 24px;
}

.random-button,
.primary-button {
    padding: 0 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hot));
    box-shadow: 0 12px 30px rgba(255, 49, 95, 0.25);
}

.primary-button {
    width: 100%;
}

.ghost-button {
    padding: 0 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
}

.compact {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    font-size: 14px;
}

.stack {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.request-card {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.request-card p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.45;
}

.eyebrow {
    color: var(--danger);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
}

time {
    color: var(--muted);
    font-size: 13px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.history-item p {
    margin-top: 5px;
    color: var(--muted);
}

.history-item time {
    flex: 0 0 auto;
    text-align: right;
}

.empty {
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}

.error {
    color: #ffd0dc;
    font-weight: 700;
}

.position-entry {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    text-decoration: none;
}

.position-entry span {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hot));
    font-size: 28px;
}

.position-entry p {
    margin-top: 5px;
    color: var(--muted);
}

.position-feature {
    display: grid;
    gap: 18px;
    padding: 18px;
}

.position-copy {
    display: grid;
    gap: 8px;
}

.position-copy p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.45;
}

.position-actions {
    display: grid;
    gap: 10px;
}

.position-actions form,
.mini-position form {
    margin: 0;
}

.positions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.mini-position {
    display: grid;
    gap: 10px;
    padding: 10px;
}

.mini-position.is-selected {
    border-color: rgba(255, 49, 95, 0.7);
}

.mini-position a {
    display: grid;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
}

.mini-position strong {
    line-height: 1.2;
}

.pose-image-wrap {
    display: grid;
    min-height: 210px;
    margin: 0;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: #151216;
}

.pose-image-wrap.mini {
    min-height: 118px;
    aspect-ratio: 4 / 3;
}

.pose-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pose-stage {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background:
        radial-gradient(circle at 28% 28%, rgba(255, 122, 69, 0.28), transparent 9rem),
        radial-gradient(circle at 72% 68%, rgba(255, 49, 95, 0.28), transparent 9rem),
        linear-gradient(145deg, #20171f, #121014);
}

.pose-stage.mini {
    min-height: 118px;
}

.pose-dot,
.pose-body,
.pose-link {
    position: absolute;
    display: block;
}

.pose-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff0f6;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.18);
}

.pose-body {
    width: 92px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff315f, #ff7a45);
    transform-origin: center;
}

.body-b {
    background: linear-gradient(135deg, #ffd3df, #ff9d76);
}

.dot-b {
    background: #ffd3df;
}

.pose-link {
    width: 58px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-link 1.8s ease-in-out infinite;
}

.pose-spoons .dot-a { left: 25%; top: 36%; animation: drift-a 2.2s ease-in-out infinite; }
.pose-spoons .body-a { left: 30%; top: 48%; transform: rotate(8deg); animation: sway-soft 2.2s ease-in-out infinite; }
.pose-spoons .dot-b { left: 39%; top: 31%; animation: drift-b 2.2s ease-in-out infinite; }
.pose-spoons .body-b { left: 44%; top: 43%; transform: rotate(8deg); animation: sway-soft-b 2.2s ease-in-out infinite; }

.pose-face .dot-a { left: 25%; top: 34%; animation: nod-a 1.9s ease-in-out infinite; }
.pose-face .body-a { left: 24%; top: 51%; transform: rotate(24deg); animation: lean-in 1.9s ease-in-out infinite; }
.pose-face .dot-b { right: 25%; top: 34%; animation: nod-b 1.9s ease-in-out infinite; }
.pose-face .body-b { right: 24%; top: 51%; transform: rotate(-24deg); animation: lean-in-b 1.9s ease-in-out infinite; }

.pose-top .dot-a { left: 42%; top: 18%; animation: bob-top 1.5s ease-in-out infinite; }
.pose-top .body-a { left: 36%; top: 34%; transform: rotate(90deg); animation: bob-body 1.5s ease-in-out infinite; }
.pose-top .dot-b { left: 38%; top: 61%; }
.pose-top .body-b { left: 31%; top: 70%; transform: rotate(0deg); animation: breathe 2s ease-in-out infinite; }

.pose-sit .dot-a { left: 31%; top: 30%; animation: nod-a 2s ease-in-out infinite; }
.pose-sit .body-a { left: 29%; top: 49%; transform: rotate(82deg); animation: sit-rock 2s ease-in-out infinite; }
.pose-sit .dot-b { right: 31%; top: 30%; animation: nod-b 2s ease-in-out infinite; }
.pose-sit .body-b { right: 29%; top: 49%; transform: rotate(-82deg); animation: sit-rock-b 2s ease-in-out infinite; }

.pose-stand .dot-a { left: 34%; top: 17%; animation: bob-top 1.7s ease-in-out infinite; }
.pose-stand .body-a { left: 31%; top: 38%; transform: rotate(86deg); animation: stand-shift 1.7s ease-in-out infinite; }
.pose-stand .dot-b { right: 34%; top: 17%; animation: bob-top-b 1.7s ease-in-out infinite; }
.pose-stand .body-b { right: 31%; top: 38%; transform: rotate(-86deg); animation: stand-shift-b 1.7s ease-in-out infinite; }

.pose-wall .dot-a { left: 62%; top: 20%; animation: wall-dot 2s ease-in-out infinite; }
.pose-wall .body-a { left: 59%; top: 41%; transform: rotate(90deg); animation: wall-body 2s ease-in-out infinite; }
.pose-wall .dot-b { left: 34%; top: 32%; animation: nod-a 2s ease-in-out infinite; }
.pose-wall .body-b { left: 31%; top: 51%; transform: rotate(72deg); animation: lean-in 2s ease-in-out infinite; }

.pose-side .dot-a { left: 25%; top: 42%; animation: drift-a 2.4s ease-in-out infinite; }
.pose-side .body-a { left: 30%; top: 55%; transform: rotate(-8deg); animation: sway-side-a 2.4s ease-in-out infinite; }
.pose-side .dot-b { right: 25%; top: 36%; animation: drift-b 2.4s ease-in-out infinite; }
.pose-side .body-b { right: 30%; top: 50%; transform: rotate(-16deg); animation: sway-side-b 2.4s ease-in-out infinite; }

.pose-edge .dot-a { left: 25%; top: 36%; animation: nod-a 1.8s ease-in-out infinite; }
.pose-edge .body-a { left: 25%; top: 55%; transform: rotate(0deg); animation: breathe 1.8s ease-in-out infinite; }
.pose-edge .dot-b { right: 29%; top: 22%; animation: bob-top 1.8s ease-in-out infinite; }
.pose-edge .body-b { right: 28%; top: 44%; transform: rotate(-82deg); animation: stand-shift-b 1.8s ease-in-out infinite; }

.pose-knees .dot-a { left: 31%; top: 44%; animation: kneel-a 1.6s ease-in-out infinite; }
.pose-knees .body-a { left: 28%; top: 59%; transform: rotate(22deg); animation: kneel-body 1.6s ease-in-out infinite; }
.pose-knees .dot-b { right: 31%; top: 38%; animation: kneel-b 1.6s ease-in-out infinite; }
.pose-knees .body-b { right: 28%; top: 54%; transform: rotate(-28deg); animation: kneel-body-b 1.6s ease-in-out infinite; }

.pose-hug .dot-a { left: 35%; top: 30%; animation: hug-a 2.3s ease-in-out infinite; }
.pose-hug .body-a { left: 31%; top: 50%; transform: rotate(72deg); animation: hug-body-a 2.3s ease-in-out infinite; }
.pose-hug .dot-b { right: 35%; top: 30%; animation: hug-b 2.3s ease-in-out infinite; }
.pose-hug .body-b { right: 31%; top: 50%; transform: rotate(-72deg); animation: hug-body-b 2.3s ease-in-out infinite; }

.pose-diagonal .dot-a { left: 27%; top: 25%; animation: diagonal-a 1.9s ease-in-out infinite; }
.pose-diagonal .body-a { left: 29%; top: 44%; transform: rotate(42deg); animation: diagonal-body-a 1.9s ease-in-out infinite; }
.pose-diagonal .dot-b { right: 27%; top: 52%; animation: diagonal-b 1.9s ease-in-out infinite; }
.pose-diagonal .body-b { right: 29%; top: 61%; transform: rotate(42deg); animation: diagonal-body-b 1.9s ease-in-out infinite; }

.pose-rhythm .dot-a { left: 30%; top: 27%; animation: rhythm-a 1.3s ease-in-out infinite; }
.pose-rhythm .body-a { left: 29%; top: 47%; transform: rotate(58deg); animation: rhythm-body-a 1.3s ease-in-out infinite; }
.pose-rhythm .dot-b { right: 30%; top: 35%; animation: rhythm-b 1.3s ease-in-out infinite; }
.pose-rhythm .body-b { right: 29%; top: 53%; transform: rotate(-58deg); animation: rhythm-body-b 1.3s ease-in-out infinite; }

@keyframes pulse-link {
    50% { opacity: 0.45; transform: translate(-50%, -50%) scaleX(1.18); }
}

@keyframes drift-a { 50% { transform: translate(6px, 2px); } }
@keyframes drift-b { 50% { transform: translate(-6px, -2px); } }
@keyframes sway-soft { 50% { transform: translate(7px, 1px) rotate(11deg); } }
@keyframes sway-soft-b { 50% { transform: translate(-7px, -1px) rotate(5deg); } }
@keyframes nod-a { 50% { transform: translate(4px, 5px); } }
@keyframes nod-b { 50% { transform: translate(-4px, 5px); } }
@keyframes lean-in { 50% { transform: translate(9px, 0) rotate(30deg); } }
@keyframes lean-in-b { 50% { transform: translate(-9px, 0) rotate(-30deg); } }
@keyframes bob-top { 50% { transform: translateY(9px); } }
@keyframes bob-top-b { 50% { transform: translateY(7px); } }
@keyframes bob-body { 50% { transform: translateY(10px) rotate(90deg); } }
@keyframes breathe { 50% { transform: translateY(2px) scaleX(1.06); } }
@keyframes sit-rock { 50% { transform: translate(5px, 1px) rotate(76deg); } }
@keyframes sit-rock-b { 50% { transform: translate(-5px, 1px) rotate(-76deg); } }
@keyframes stand-shift { 50% { transform: translate(5px, 6px) rotate(82deg); } }
@keyframes stand-shift-b { 50% { transform: translate(-5px, 6px) rotate(-82deg); } }
@keyframes wall-dot { 50% { transform: translateY(5px); } }
@keyframes wall-body { 50% { transform: translateY(5px) rotate(90deg); } }
@keyframes sway-side-a { 50% { transform: translate(7px, 1px) rotate(-4deg); } }
@keyframes sway-side-b { 50% { transform: translate(-7px, -1px) rotate(-20deg); } }
@keyframes kneel-a { 50% { transform: translate(7px, 4px); } }
@keyframes kneel-b { 50% { transform: translate(-7px, 4px); } }
@keyframes kneel-body { 50% { transform: translate(8px, 3px) rotate(16deg); } }
@keyframes kneel-body-b { 50% { transform: translate(-8px, 3px) rotate(-22deg); } }
@keyframes hug-a { 50% { transform: translate(8px, 3px); } }
@keyframes hug-b { 50% { transform: translate(-8px, 3px); } }
@keyframes hug-body-a { 50% { transform: translate(8px, 0) rotate(66deg); } }
@keyframes hug-body-b { 50% { transform: translate(-8px, 0) rotate(-66deg); } }
@keyframes diagonal-a { 50% { transform: translate(7px, 7px); } }
@keyframes diagonal-b { 50% { transform: translate(-7px, -7px); } }
@keyframes diagonal-body-a { 50% { transform: translate(8px, 8px) rotate(37deg); } }
@keyframes diagonal-body-b { 50% { transform: translate(-8px, -8px) rotate(47deg); } }
@keyframes rhythm-a { 50% { transform: translate(10px, 4px); } }
@keyframes rhythm-b { 50% { transform: translate(-10px, -4px); } }
@keyframes rhythm-body-a { 50% { transform: translate(10px, 4px) rotate(51deg); } }
@keyframes rhythm-body-b { 50% { transform: translate(-10px, -4px) rotate(-51deg); } }

@media (min-width: 680px) {
    .page {
        padding-top: 40px;
    }

    .preset-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .position-feature {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }

    .position-actions {
        grid-column: 1 / -1;
        grid-template-columns: 1fr 1fr;
    }

    .positions-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
