:root {
    --paper: #F3F3EF;
    --ink: #000000;

    --frame-offset: 15px;
    --frame-gap: var(--frame-offset);
    --frame-border: 5px;

    --safe-top: env(safe-area-inset-top);
    --safe-right: env(safe-area-inset-right);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
}

* { box-sizing: border-box; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', 'Space Grotesk', system-ui, sans-serif;
}

.blue-frame {
    position: fixed;
    top: calc(var(--frame-offset) + var(--safe-top));
    right: calc(var(--frame-offset) + var(--safe-right));
    bottom: calc(var(--frame-offset) + var(--safe-bottom));
    left: calc(var(--frame-offset) + var(--safe-left));
    border: var(--frame-border) solid var(--blue-pure);
    background: var(--paper);
    padding: var(--frame-gap);
    overflow: hidden;
    z-index: 2;
}

.art-stage {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--paper);
    cursor: crosshair;
}

.art-canvas {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.art-noscript {
    position: absolute;
    inset: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: 14px;
    justify-content: center;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    color: rgb(var(--ink-rgb) / 0.55);
}
.art-noscript p { flex-basis: 100%; margin: 0; }
.art-noscript img { max-width: 40%; height: auto; width: 240px; }

.art-pick {
    position: fixed;
    inset: 0;
    z-index: calc(var(--layer-note, 900) + 2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-offset, 35px) + var(--safe-top, 0px))
             calc(var(--header-offset, 35px) + var(--safe-right, 0px))
             calc(var(--header-offset, 35px) + var(--safe-bottom, 0px))
             calc(var(--header-offset, 35px) + var(--safe-left, 0px));
    background: rgb(var(--ink-rgb, 0 0 0) / 0.08);
}

.art-pick[hidden] { display: none; }

.art-pick-card {
    position: relative;
    max-width: min(900px, 100%);
    max-height: 100%;
    overflow-y: auto;
    box-sizing: border-box;

    background: var(--paper, #F3F3EF);
    color: var(--ink, #000000);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.26);
    padding: 24px 28px 22px;

    font-size: 14px;
    line-height: 1.6;
}

.art-pick-card h2 {
    margin: 0 0 16px;
    padding-right: 26px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    text-wrap: balance;
}

.art-pick-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    color: var(--ink, #000000);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.art-pick-close:hover { color: var(--header-accent, #0000FF); }

.art-pick-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.art-pick-sub {
    margin: 22px 0 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(var(--ink-rgb, 0 0 0) / 0.45);
}

.art-pick-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 116px;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.art-pick-shot {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--shot-h, 150px);
    width: 100%;
    position: relative;
}

.art-pick-shot img {
    display: block;
    width: var(--shot-w, 100px);
    height: var(--shot-h, 150px);
    box-shadow: 0 1px 7px rgb(var(--ink-rgb, 0 0 0) / 0.3);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.art-pick-shot img.is-guest {
    object-fit: cover;
    object-position: 50% 30%;
}

.art-pick-tile:hover .art-pick-shot img,
.art-pick-tile:focus-visible .art-pick-shot img {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgb(var(--ink-rgb, 0 0 0) / 0.36);
}

.art-pick-tile[aria-pressed="true"] .art-pick-shot img {
    outline: 2px solid var(--blue-pure, #0000FF);
    outline-offset: 3px;
}

.art-pick-tile:focus { outline: none; }
.art-pick-tile:focus-visible .art-pick-shot img {
    outline: 2px solid var(--blue-pure, #0000FF);
    outline-offset: 3px;
}

.art-pick-name {
    min-height: 2.6em;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
}

.art-pick-by {
    font-size: 11px;
    line-height: 1.3;
    color: rgb(var(--ink-rgb, 0 0 0) / 0.5);
}

.art-pick-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--shot-h, 150px);
    width: var(--shot-w, 100px);
    border: 1px dashed rgb(var(--ink-rgb, 0 0 0) / 0.35);
    border-radius: 3px;
    color: rgb(var(--ink-rgb, 0 0 0) / 0.5);
}

.art-pick-tile:hover .art-pick-drop,
.art-pick-tile:focus-visible .art-pick-drop {
    border-color: var(--blue-pure, #0000FF);
    color: var(--blue-pure, #0000FF);
}

.art-pick-drop svg { width: 26px; height: 26px; }

.art-pick-note {
    margin: 18px 0 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: rgb(var(--ink-rgb, 0 0 0) / 0.5);
}

.art-pick-note.is-error { color: #C0392B; }

@media (max-width: 560px) {
    .art-pick-card { padding: 18px 16px 16px; border-radius: 14px; font-size: 13px; }
    .art-pick-card h2 { font-size: 15px; margin-bottom: 12px; }
    .art-pick-row { gap: 12px 8px; }
    .art-pick-tile { width: 88px; gap: 5px; }
    .art-pick-row { --shot-w: 70px; --shot-h: 105px; }
    .art-pick-drop svg { width: 20px; height: 20px; }
    .art-pick-name { font-size: 11px; }
    .art-pick-by { font-size: 10px; }
    .art-pick-sub { margin: 16px 0 10px; font-size: 11px; }
    .art-pick-note { font-size: 11px; margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .art-pick-shot img { transition: none; }
    .art-pick-tile:hover .art-pick-shot img,
    .art-pick-tile:focus-visible .art-pick-shot img { transform: none; }
}
