:root {
    color-scheme: light;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background:
        linear-gradient(rgba(93, 67, 42, 0.065) 1px, transparent 1px),
        linear-gradient(90deg, rgba(93, 67, 42, 0.065) 1px, transparent 1px),
        #d7c7ad;
    background-size: 28px 28px, 28px 28px, auto;
    color: #2b2118;
    font-family: var(--font-mono), ui-monospace, SFMono-Regular, Menlo, monospace;
}

button {
    color: inherit;
    font: inherit;
}

.moodboard-page {
    width: min(1160px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr minmax(320px, 430px) 1fr;
    gap: 18px;
    align-items: stretch;
}

.panel,
.phone-shell {
    border: 2px solid #2b2118;
    background: #f8f0df;
    box-shadow: 7px 9px 0 rgba(43, 33, 24, 0.14);
}

.panel {
    min-width: 0;
    padding: 22px;
}

.intro-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: rotate(-0.4deg);
    min-height: calc(100vh - 36px);
}

.board-panel {
    transform: rotate(0.35deg);
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kicker {
    margin-bottom: 12px;
    color: rgba(43, 33, 24, 0.72);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.intro-panel h1 {
    max-width: 13ch;
    margin: 0 0 18px;
    font-family: "Reenie Beanie", "Bradley Hand", "Segoe Print", cursive;
    font-size: clamp(46px, 6vw, 68px);
    font-weight: 400;
    line-height: 0.92;
}

.intro-panel p,
.empty-state,
.taste-copy {
    color: rgba(43, 33, 24, 0.7);
    font-size: 14px;
    line-height: 1.55;
}

.category-picker {
    margin-top: 16px;
    padding: 12px;
    border: 1.5px solid #2b2118;
    background: rgba(255, 248, 232, 0.55);
}

.category-picker label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.category-picker select {
    width: 100%;
    min-height: 34px;
    border: 1px solid #2b2118;
    background: #fff8e8;
    color: #2b2118;
    padding: 0 8px;
}

.category-picker p {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: rgba(43, 33, 24, 0.72);
}

.taste-note {
    margin-top: 28px;
    padding: 16px;
    border: 1.5px solid #2b2118;
    background: #f4df82;
    box-shadow: 4px 5px 0 rgba(43, 33, 24, 0.12);
    transform: rotate(1.2deg);
}

.taste-label {
    display: block;
    margin-bottom: 7px;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.taste-note strong {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-primary), Arial, sans-serif;
    font-size: 22px;
    line-height: 1;
}

.phone-shell {
    min-height: calc(100vh - 36px);
    padding: 12px;
    display: flex;
    flex-direction: column;
    background: #211a14;
    border-radius: 34px;
    align-self: start;
    position: sticky;
    top: 18px;
}

.phone-topbar,
.action-row,
.board-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.phone-topbar {
    padding: 8px 8px 14px;
    color: #fff8e8;
    font-size: 12px;
}

.ghost-button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(255, 248, 232, 0.48);
    background: rgba(255, 248, 232, 0.08);
    color: #fff8e8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card-frame {
    position: relative;
    flex: 1;
    min-height: 520px;
    border-radius: 24px;
    overflow: hidden;
    background: #6c5b44;
    touch-action: none;
}

.swipe-card {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #a58d68;
    color: #fff8e8;
    touch-action: none;
    user-select: none;
    cursor: grab;
    transition: transform 180ms ease, opacity 180ms ease;
}

.swipe-card:active {
    cursor: grabbing;
}

.card-art,
.board-art {
    width: 100%;
    height: 100%;
    background: var(--card-art);
    background-size: cover;
    background-position: center;
    pointer-events: none;
}

.swipe-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 30%, rgba(0, 0, 0, 0.78));
    pointer-events: none;
}

.decision-badge {
    position: absolute;
    z-index: 5;
    top: 22px;
    padding: 8px 13px;
    border: 2px solid currentColor;
    background: rgba(0, 0, 0, 0.22);
    font-family: var(--font-primary), Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    text-transform: uppercase;
    transition: opacity 120ms ease;
}

.decision-badge.reject {
    left: 18px;
    color: #ffd8d1;
    transform: rotate(-10deg);
}

.decision-badge.save {
    right: 18px;
    color: #def7c4;
    transform: rotate(10deg);
}

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

.card-details p {
    margin-bottom: 8px;
    color: rgba(255, 248, 232, 0.72);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.card-details h2 {
    margin: 0 0 12px;
    font-family: var(--font-primary), Arial, sans-serif;
    font-size: clamp(30px, 9vw, 46px);
    line-height: 0.9;
    letter-spacing: -0.06em;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-row span {
    padding: 5px 8px;
    border: 1px solid rgba(255, 248, 232, 0.34);
    background: rgba(255, 248, 232, 0.14);
    color: rgba(255, 248, 232, 0.88);
    font-size: 11px;
}

.action-row {
    padding-top: 12px;
}

.action-button {
    flex: 1;
    min-height: 52px;
    border: 1.5px solid #2b2118;
    font-family: var(--font-primary), Arial, sans-serif;
    font-weight: 700;
    transition: transform 160ms ease;
}

.action-button:hover,
.action-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
    transform: translateY(-1px);
}

.action-button.reject {
    background: #ffe6dd;
    color: #7d342b;
}

.action-button.save {
    background: #dff2ba;
    color: #243718;
}

.board-heading {
    align-items: flex-start;
    margin-bottom: 18px;
}

.board-heading h2 {
    margin: 0;
    font-family: "Reenie Beanie", "Bradley Hand", "Segoe Print", cursive;
    font-size: 42px;
    font-weight: 400;
    line-height: 0.9;
}

.board-heading {
    gap: 18px;
}

.saved-count {
    padding-top: 8px;
    color: rgba(43, 33, 24, 0.64);
    font-size: 12px;
}

.board-heading {
    flex-shrink: 0;
}

.moodboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 122px;
    gap: 9px;
    overflow-y: auto;
    min-height: 0;
}

.moodboard-grid figure {
    overflow: hidden;
    border: 1.5px solid #2b2118;
    background: #d5c1a3;
}

.board-image-button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.board-image-button.is-selected {
    outline: 3px solid #2b2118;
    outline-offset: -3px;
}

.moodboard-grid figure:nth-child(3n + 1) {
    grid-row: span 2;
}

.moodboard-grid img,
.moodboard-grid .board-art {
    width: 100%;
    height: 100%;
}

.empty-state {
    padding: 22px;
    border: 1.5px dashed rgba(43, 33, 24, 0.42);
    background: rgba(255, 248, 232, 0.48);
}

.saved-details {
    margin-top: 14px;
    padding: 14px;
    border: 1.5px solid #2b2118;
    background: rgba(255, 248, 232, 0.72);
}

.saved-details-label {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(43, 33, 24, 0.7);
}

.saved-details h3 {
    margin: 0;
    font-family: var(--font-primary), Arial, sans-serif;
    font-size: 28px;
    line-height: 0.95;
}

.saved-category {
    margin: 8px 0 10px;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(43, 33, 24, 0.74);
}

.saved-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.saved-tags span {
    padding: 4px 8px;
    border: 1px solid rgba(43, 33, 24, 0.36);
    background: rgba(255, 248, 232, 0.92);
    font-size: 11px;
}

@media (max-width: 980px) {
    .moodboard-page {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .intro-panel,
    .board-panel,
    .phone-shell {
        transform: none;
    }

    .intro-panel {
        order: 1;
    }

    .phone-shell {
        order: 2;
        min-height: 720px;
    }

    .board-panel {
        order: 3;
    }
}

@media (max-width: 560px) {
    .moodboard-page {
        padding: 0;
        gap: 0;
    }

    .panel {
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .phone-shell {
        min-height: 100vh;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .card-frame {
        min-height: 0;
    }

    .intro-panel h1 {
        max-width: none;
        font-size: 46px;
    }

    .board-heading h2 {
        font-size: 38px;
    }
}
