:root {
    --ink: #171717;
    --paper: #ffffff;
    --soft: #f4f8ff;
    --line: #171717;
    --tomato: #ff4d3d;
    --cobalt: #245cff;
    --teal: #00b8a9;
    --lemon: #ffd43b;
    --mint: #9ef3c1;
    --pink: #ff79a8;
    --shadow: 8px 8px 0 #171717;
    --font-rounded: "Baloo 2", "Nunito Sans", system-ui, sans-serif;
    --font-display: "Baloo 2", "Nunito Sans", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background: #fbfdff;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    font-family: var(--font-rounded);
    background:
        linear-gradient(rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.9)),
        url("../img/family-stickers.webp") top center / min(1400px, 150vw) auto no-repeat,
        #fbfdff;
        background-repeat: repeat;
}

button,
textarea,
input,
select {
    font: inherit;
}

input {
    min-height: 48px;
    padding: 0 12px;
    color: var(--ink);
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 16px;
    outline: none;
    font-weight: 1000;
}

input:focus {
    box-shadow: 0 0 0 5px rgba(36, 92, 255, 0.16);
}

a,
button {
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.page-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 18px 14px 44px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(2px 3px 0 rgba(23, 23, 23, 0.22));
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: clamp(0.98rem, 2.8vw, 1.1rem);
    font-weight: 1000;
    line-height: 1;
    white-space: nowrap;
}

.brand small {
    color: #4d5562;
    font-size: 0.8rem;
    font-weight: 800;
}

.topbar-badge,
.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 34px;
    padding: 0 12px;
    color: var(--ink);
    background: var(--lemon);
    border: 3px solid var(--line);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 1000;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.composer-layout {
    display: grid;
    gap: 18px;
}

.composer-panel,
.sample-stage,
.empty-state,
.action-panel,
.viral-prompt,
.daily-court-card,
.vote-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 3px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.composer-panel {
    padding: 20px;
}

.composer-copy {
    margin-bottom: 18px;
}

h1 {
    margin: 10px 0 10px;
    font-family: var(--font-display);
    font-size: clamp(2.35rem, 8vw, 4.6rem);
    line-height: 0.9;
    letter-spacing: 0;
}

.composer-copy h1 {
    max-width: 560px;
    font-size: clamp(2.45rem, 8vw, 4.4rem);
}

.composer-copy p,
.empty-state p {
    max-width: 640px;
    margin: 0;
    color: #333a45;
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.5;
}

form {
    display: grid;
    gap: 14px;
}

.form-fields {
    display: grid;
    gap: 14px;
}

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

.mode-switch label {
    position: relative;
    cursor: pointer;
}

.mode-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-switch span {
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 0 12px;
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 999px;
    box-shadow: 3px 3px 0 var(--line);
    font-weight: 1000;
    text-align: center;
}

.mode-switch input:checked + span {
    background: var(--lemon);
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--line);
}

.option-grid {
    display: grid;
    gap: 10px;
}

.select-field {
    display: grid;
    gap: 6px;
}

.select-field span {
    font-size: 0.74rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

select {
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    color: var(--ink);
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 16px;
    box-shadow: 3px 3px 0 var(--line);
    font-weight: 1000;
}

.field-group {
    display: grid;
    gap: 8px;
}

.battle-fields {
    display: grid;
    gap: 10px;
}

.battle-fields textarea {
    min-height: 112px;
}

label {
    font-weight: 1000;
}

textarea {
    width: 100%;
    min-height: 170px;
    resize: none;
    overflow: hidden;
    padding: 16px;
    color: var(--ink);
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 18px;
    outline: none;
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.45;
}

textarea:focus {
    box-shadow: 0 0 0 5px rgba(36, 92, 255, 0.16);
}

textarea::placeholder {
    color: #89919d;
}

.textarea-wrap {
    position: relative;
}

.textarea-wrap textarea {
    padding-bottom: 42px;
}

.field-meta {
    position: absolute;
    right: 14px;
    bottom: 12px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    color: #606b78;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid var(--line);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 900;
    pointer-events: none;
}

.primary-button,
.secondary-button {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: var(--ink);
    border: 3px solid var(--line);
    border-radius: 18px;
    box-shadow: 4px 4px 0 var(--line);
    font-weight: 1000;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    background: var(--teal);
}

.submit-judge-button {
    gap: 10px;
}

.submit-judge-button .button-logo {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(1px 2px 0 rgba(23, 23, 23, 0.24));
}

.secondary-button {
    background: #fff;
}

.image-action {
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100px;
    padding: 10px 8px;
}

.image-action img {
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    object-fit: contain;
}

.image-action .button-label {
    flex: 0 1 auto;
    min-width: 0;
    text-align: center;
    line-height: 1.08;
}

.button-label {
    font-size: 1.5rem;
}

button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.loading-message,
.error-message {
    min-height: 21px;
    margin: 0;
    font-size: 0.94rem;
    font-weight: 1000;
}

.loading-message {
    color: var(--cobalt);
}

.error-message {
    color: var(--tomato);
}

.result-skeleton {
    pointer-events: auto;
}

.skeleton-hero {
    display: grid;
    gap: 12px;
    align-items: center;
}

.skeleton-seal {
    width: min(156px, 100%);
}

.skeleton-verdict h2 {
    display: grid;
    gap: 9px;
    margin-top: 8px;
}

.skeleton-line {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    max-width: 100%;
    height: 14px;
    background: #e5ebf5;
    border: 2px solid rgba(27, 31, 42, 0.2);
    border-radius: 999px;
}

.skeleton-line::after {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent);
    transform: translateX(-110%);
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-line.wide { width: 100%; }
.skeleton-line.medium { width: 74%; }
.skeleton-line.short { width: 46%; }

.result-skeleton .chat-message p,
.result-skeleton .auntie-message p,
.result-skeleton .decision-note p,
.result-skeleton .verdict-ticket p {
    display: grid;
    gap: 7px;
}

.result-skeleton [data-result-field].is-loaded {
    display: block;
    animation: result-fill 180ms ease-out both;
}

.result-skeleton .seal-rating strong.is-loaded {
    display: block;
}

.sample-stage {
    display: grid;
    align-items: center;
    padding: 18px;
}

.sample-card-stack {
    position: relative;
    width: min(380px, 100%);
    height: 542px;
    margin: 0 auto;
    touch-action: pan-y;
}

.sample-card {
    position: absolute;
    inset: 0;
    width: min(380px, 100%);
    margin: 0 auto;
    padding: 16px;
    color: var(--ink);
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 22px;
    box-shadow: 6px 6px 0 var(--line);
    transform:
        translate(calc(var(--stack-position, 0) * 9px), calc(var(--stack-position, 0) * 10px))
        rotate(var(--stack-rotation, 0deg))
        scale(var(--stack-scale, 1));
    transition:
        transform 260ms ease,
        opacity 180ms ease,
        box-shadow 180ms ease;
    will-change: transform;
}

.sample-card:hover {
    box-shadow: 9px 9px 0 var(--line);
}

.sample-card-link {
    display: block;
    color: var(--ink);
    text-decoration: none;
    user-select: none;
    -webkit-user-drag: none;
}

.sample-card:not(.is-active) {
    pointer-events: none;
}

.sample-card.is-active {
    cursor: grab;
    box-shadow: 8px 8px 0 var(--line);
}

.sample-card-stack.is-hinting .sample-card.is-active {
    animation: swipe-card-hint 5s ease-in-out both;
}

.sample-card.is-dragging {
    cursor: grabbing;
    transition: none;
    animation: none;
}

.sample-card.is-flying {
    opacity: 0;
    pointer-events: none;
    transition:
        transform 220ms cubic-bezier(0.42, 0, 0.2, 1),
        opacity 160ms ease;
}

.sample-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--line);
}

.sample-card-top span,
.mini-label {
    font-weight: 1000;
    text-transform: uppercase;
}

.sample-card-top strong {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: var(--pink);
    border: 3px solid var(--line);
    border-radius: 999px;
    font-size: 1.4rem;
    font-weight: 1000;
}

.sample-case {
    height: 55px;
    margin: 14px 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.05;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.sample-lines {
    display: grid;
    gap: 8px;
}

.sample-lines p,
.sample-verdict {
    margin: 0;
    padding: 11px;
    overflow: hidden;
    border: 3px solid var(--line);
    border-radius: 16px;
    font-weight: 950;
    line-height: 1.28;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.sample-lines p {
    height: 74px;
    background: var(--soft);
    -webkit-line-clamp: 3;
}

.sample-lines span {
    display: block;
    color: var(--cobalt);
    font-size: 0.72rem;
    font-weight: 1000;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sample-verdict {
    height: 82px;
    margin-top: 10px;
    background: var(--lemon);
    -webkit-line-clamp: 3;
}

.sample-watermark,
.watermark {
    margin-top: 12px;
    color: #747d89;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 1000;
}

.discovery-section {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.daily-court-card {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding: 16px;
}

.daily-court-card h2,
.vote-panel h2 {
    margin: 8px 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 6vw, 2.9rem);
    line-height: 0.95;
}

.daily-court-card p {
    margin: 8px 0 0;
    font-size: 1.12rem;
    font-weight: 1000;
    line-height: 1.26;
}

.section-heading {
    display: grid;
    gap: 8px;
    align-items: end;
}

.section-heading h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3.2rem);
    line-height: 0.95;
}

.leaderboard-heading {
    margin-top: 10px;
}

.judgment-grid,
.leaderboard-grid {
    display: grid;
    gap: 12px;
}

.judgment-tile,
.leaderboard-card,
.leaderboard-row {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    border: 3px solid var(--line);
    text-decoration: none;
}

.judgment-tile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    padding: 14px;
    border-radius: 20px;
    box-shadow: 5px 5px 0 var(--line);
}

.judgment-tile span,
.judgment-tile b,
.leaderboard-card h3 {
    font-size: 0.72rem;
    font-weight: 1000;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.judgment-tile strong {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    background: var(--pink);
    border: 3px solid var(--line);
    border-radius: 999px;
    font-weight: 1000;
}

.judgment-tile p {
    grid-column: 1 / -1;
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.32rem;
    font-weight: 800;
    line-height: 1.02;
}

.judgment-tile b {
    color: var(--cobalt);
}

.leaderboard-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 20px;
    box-shadow: 5px 5px 0 var(--line);
}

.leaderboard-card h3 {
    margin: 0;
    color: var(--cobalt);
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 42px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.judgment-tile,
.leaderboard-card {
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.judgment-tile:hover,
.leaderboard-card:hover,
.leaderboard-row:hover {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--line);
}

.leaderboard-row span,
.leaderboard-row strong {
    display: grid;
    place-items: center;
    min-height: 30px;
    border: 3px solid var(--line);
    border-radius: 999px;
    font-weight: 1000;
}

.leaderboard-row span {
    background: var(--lemon);
}

.leaderboard-row strong {
    background: var(--mint);
}

.leaderboard-row p {
    margin: 0;
    font-weight: 1000;
    line-height: 1.12;
}

.result-shell {
    display: grid;
    gap: 16px;
    justify-items: center;
}

.result-topbar,
.action-panel,
.viral-prompt,
.vote-panel,
.result-stage-poster,
.empty-state {
    width: min(760px, 100%);
}

.poster-card {
    width: 100%;
    overflow: hidden;
    padding: 18px;
    padding-top: 0px;
    color: var(--ink);
    background:
        linear-gradient(rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.96)),
        radial-gradient(circle at top right, #dce7ff, transparent 18rem);
    border: 4px solid var(--line);
    border-radius: 28px;
    box-shadow: 9px 9px 0 var(--line);
}

.poster-hero {
    display: grid;
    align-items: center;
    padding: 0 0 0px;
}

.score-medallion {
    position: relative;
    width: min(180px, 100%);
    aspect-ratio: 1;
    justify-self: center;
    display: grid;
    place-items: center;
    transform: rotate(-5deg);
}

.verdict-sticker span,
.decision-note span,
.verdict-ticket span {
    font-size: 0.7rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wax-seal-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(4px 6px 0 rgba(27, 31, 42, 0.22));
}

.seal-rating {
    position: absolute;
    inset: 53% auto auto 50%;
    display: grid;
    place-items: center;
    min-width: 78px;
    transform: translate(-50%, -48%) rotate(4deg);
    color: #fff7ef;
    text-align: center;
    text-shadow:
        0 2px 0 rgba(82, 0, 0, 0.58),
        0 0 10px rgba(72, 0, 0, 0.42);
}

.seal-rating strong {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    line-height: 0.82;
    letter-spacing: 0;
}

.seal-rating span {
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
}

.verdict-sticker {
    padding: 14px;
    background: var(--mint);
    border: 4px solid var(--line);
    border-radius: 22px;
    box-shadow: 5px 5px 0 var(--line);
}

.verdict-sticker span,
.decision-note span {
    color: var(--cobalt);
}

.verdict-sticker h2 {
    margin: 5px 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 8vw, 2.7rem);
    line-height: 0.88;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.viral-badge-strip {
    position: relative;
    display: block;
    min-height: 58px;
    margin: 12px 0;
    overflow: hidden;
}

.viral-badge {
    position: absolute;
    inset: 4px 4px 6px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    place-items: center;
    padding: 7px 8px;
    border: 3px solid var(--line);
    border-radius: 16px;
    box-shadow: 3px 3px 0 var(--line);
    font-size: 1rem;
    font-weight: 1000;
    line-height: 1.08;
    text-align: center;
    text-transform: uppercase;
    opacity: 0;
    transform: translateX(24px) scale(0.96);
    animation: badge-cycle 9s ease-in-out infinite;
}

.viral-badge:nth-child(2) { animation-delay: 3s; }
.viral-badge:nth-child(3) { animation-delay: 6s; }
.viral-badge:nth-child(4) { animation-delay: 9s; }

.badge-mint { background: var(--mint); }
.badge-lemon { background: var(--lemon); }
.badge-pink { background: var(--pink); }
.badge-tomato { background: var(--tomato); }
.badge-cobalt {
    color: #fff;
    background: var(--cobalt);
}

.decision-note,
.battle-matchup,
.verdict-ticket {
    border: 3px solid var(--line);
    border-radius: 20px;
}

.decision-note {
    padding: 5px;
    background: #f2f6ff;
}

.decision-note p {
    margin: 0px 0 0;
    font-size: 1.18rem;
    font-weight: 1000;
    line-height: 1.22;
}

.battle-matchup {
    padding: 13px;
    background: #f2f6ff;
}

.battle-matchup > span,
.chat-head span,
.viral-prompt > span {
    color: var(--cobalt);
    font-size: 0.7rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.battle-matchup div {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.battle-matchup p {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 1000;
    line-height: 1.22;
}

.battle-matchup b {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: var(--lemon);
    border: 3px solid var(--line);
    border-radius: 50%;
    line-height: 1;
}

.family-chat {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: #eef3ff;
    border: 3px solid var(--line);
    border-radius: 20px;
}

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-head b {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.chat-message {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}

.chat-avatar {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.chat-message div {
    padding: 9px 10px;
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 16px;
}

.chat-message span {
    display: block;
    color: var(--cobalt);
    font-size: 0.66rem;
    font-weight: 1000;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chat-message p {
    margin: 3px 0 0;
    font-weight: 700;
    line-height: 1.28;
    font-size: 1.3rem;
}
.auntie-social-chat {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: #fff7cf;
    border: 3px solid var(--line);
    border-radius: 20px;
}

.auntie-message {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}

.auntie-avatar {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.auntie-message div {
    padding: 9px 10px;
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 16px;
}

.auntie-message span {
    display: block;
    color: var(--cobalt);
    font-size: 0.66rem;
    font-weight: 1000;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auntie-message p {
    margin: 3px 0 0;
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.28;
}

.verdict-ticket {
    margin-top: 12px;
    padding: 15px;
    background: var(--tomato);
    box-shadow: 5px 5px 0 var(--line);
}

.tone-approved .verdict-ticket { background: var(--teal); }
.tone-warning .verdict-ticket { background: var(--lemon); }

.verdict-ticket p {
    margin: 5px 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 5vw, 2.35rem);
    font-weight: 800;
    line-height: 1.02;
}

.action-panel,
.viral-prompt,
.vote-panel,
.empty-state {
    padding: 16px;
}

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

.action-panel-single {
    grid-template-columns: minmax(0, 1fr);
}

.action-panel-single .image-action {
    min-height: 78px;
}

.action-panel .loading-message {
    grid-column: 1 / -1;
    text-align: center;
}

.generation-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
}

.generation-progress span {
    min-height: 34px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    color: #4d5562;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 1000;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
}

.generation-progress span.is-complete {
    color: var(--ink);
    background: var(--mint);
}

.generation-progress span.is-active {
    color: var(--ink);
    background: var(--lemon);
    box-shadow: 2px 2px 0 var(--line);
}

.retry-generation-button {
    background: var(--lemon);
}

.share-surface {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.96);
    border: 3px solid var(--line);
    border-radius: 999px;
    box-shadow: 4px 4px 0 var(--line);
}

.share-icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--ink);
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
}

.share-main-button {
    background: var(--lemon);
}

.share-icon-button img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.share-icon-button:hover,
.share-icon-button:focus-visible {
    transform: translate(1px, 1px);
}

.share-toast {
    position: absolute;
    right: 0;
    bottom: calc(100% + 7px);
    min-height: 28px;
    display: grid;
    place-items: center;
    padding: 0 10px;
    color: var(--ink);
    background: var(--mint);
    border: 2px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 1000;
    white-space: nowrap;
}

.share-toast:empty {
    display: none;
}

.create-surface {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 40;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    background: var(--teal);
    border: 3px solid var(--line);
    border-radius: 50%;
    box-shadow: 4px 4px 0 var(--line);
}

.create-surface img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.create-surface:hover,
.create-surface:focus-visible {
    transform: translate(1px, 1px);
    box-shadow: 3px 3px 0 var(--line);
}

.viral-prompt p {
    margin: 5px 0 0;
    font-weight: 1000;
    line-height: 1.25;
}

.mini-empty-state {
    display: grid;
    gap: 10px;
    align-content: center;
    min-height: 320px;
    padding: 18px;
    text-align: center;
}

.mini-empty-state h2,
.public-empty-state h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 5vw, 2.7rem);
    line-height: 0.95;
}

.mini-empty-state p,
.public-empty-state p {
    margin: 0 auto;
    max-width: 520px;
    color: #333a45;
    font-weight: 900;
    line-height: 1.35;
}

.public-empty-state {
    display: grid;
    gap: 10px;
    text-align: center;
}

.viral-prompt {
    text-align: center;
}

.vote-panel {
    display: grid;
    gap: 14px;
}

.vote-panel h2 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.vote-summary {
    display: grid;
    gap: 6px;
    padding: 12px;
    background: #f2f6ff;
    border: 3px solid var(--line);
    border-radius: 18px;
}

.vote-summary strong {
    font-size: 1.1rem;
    font-weight: 1000;
    line-height: 1.1;
}

.vote-summary > span {
    width: fit-content;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    background: var(--lemon);
    border: 2px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 1000;
    text-transform: uppercase;
}

.vote-summary p {
    margin: 0;
    color: #333a45;
    font-weight: 900;
    line-height: 1.28;
}

.vote-share-button {
    width: fit-content;
    min-height: 46px;
    gap: 8px;
    padding: 0 12px;
    background: var(--mint);
    border-radius: 14px;
    box-shadow: 3px 3px 0 var(--line);
    font-size: 0.86rem;
}

.vote-share-button img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

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

.vote-button {
    min-height: 110px;
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    text-align: left;
}

.vote-button-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.vote-button-top > span,
.vote-button strong {
    font-weight: 1000;
}

.vote-button-top > span {
    overflow-wrap: anywhere;
}

.vote-button strong {
    min-width: 46px;
    min-height: 38px;
    display: grid;
    place-items: center;
    background: var(--lemon);
    border: 3px solid var(--line);
    border-radius: 999px;
}

.vote-meter {
    height: 16px;
    display: block;
    overflow: hidden;
    background: #eef3ff;
    border: 3px solid var(--line);
    border-radius: 999px;
}

.vote-meter i {
    width: var(--vote-share, 0%);
    height: 100%;
    display: block;
    background: var(--teal);
    border-right: 3px solid var(--line);
    transition: width 220ms ease;
}

.vote-button[data-vote="overreacted"] .vote-meter i {
    background: var(--pink);
}

.vote-percent {
    color: #333a45;
    font-size: 0.82rem;
    font-weight: 1000;
    text-align: right;
}

.vote-button.is-selected {
    background: var(--mint);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--line);
}

.poster-card .score-medallion {
    animation: seal-drop 520ms cubic-bezier(0.2, 0.85, 0.2, 1.25) both;
}

.poster-card .verdict-sticker {
    animation: sticker-pop 420ms ease-out 170ms both;
}

.poster-card .chat-message,
.poster-card .auntie-message {
    animation: message-slide 360ms ease-out both;
}

.poster-card .chat-message:nth-of-type(2) { animation-delay: 120ms; }
.poster-card .chat-message:nth-of-type(3) { animation-delay: 220ms; }
.poster-card .chat-message:nth-of-type(4) { animation-delay: 320ms; }
.poster-card .chat-message:nth-of-type(5) { animation-delay: 420ms; }
.poster-card .chat-message:nth-of-type(6) { animation-delay: 520ms; }
.poster-card .auntie-message:nth-of-type(2) { animation-delay: 180ms; }
.poster-card .auntie-message:nth-of-type(3) { animation-delay: 280ms; }
.poster-card .auntie-message:nth-of-type(4) { animation-delay: 380ms; }

.poster-card .verdict-ticket {
    animation: order-stamp 460ms ease-out 560ms both;
}

.viral-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.link-button {
    width: 100%;
}

@media (min-width: 760px) {
    .page-shell {
        padding: 10px 24px 60px;
    }

    .composer-layout {
        min-height: calc(93vh - 122px);
        grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
        align-items: center;
    }

    .composer-panel {
        padding: 34px;
    }

    .option-grid,
    .battle-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .poster-hero {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .skeleton-hero {
        grid-template-columns: 190px minmax(0, 1fr);
    }

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

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

    .viral-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .daily-court-card {
        grid-template-columns: minmax(0, 1fr) 220px;
        align-items: center;
    }

    .vote-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding-left: 10px;
        padding-right: 10px;
        padding-top: 5px;
    }

    h1,h2{
        font-size: 1.75rem!important;
    }

    textarea {
        min-height: 105px!important;
    }

    .textarea-wrap textarea{
        padding:16px;

    }

    .composer-panel {
        margin-top: 10px;
        padding:7px!important;
    }

    .brand small {
        display: none;
    }

    .brand {
        gap: 7px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .topbar-badge {
        min-height: 30px;
        padding: 0 9px;
        font-size: 0.62rem;
    }

    h1 {
        font-size: clamp(2.35rem, 12vw, 3.5rem);
    }

    .composer-panel,
    .sample-stage,
    .poster-card {
        box-shadow: 5px 5px 0 var(--line);
    }

    .sample-card-stack {
        height: 536px;
    }

    .family-chat {
        padding: 5px!important;
        gap: 3px!important;
    }

    .auntie-social-chat {
        gap: 3px!important;
    }

    .sample-card {
        transform:
            translate(calc(var(--stack-position, 0) * 5px), calc(var(--stack-position, 0) * 8px))
            rotate(calc(var(--stack-rotation, 0deg) * 0.65))
            scale(var(--stack-scale, 1));
    }

    .poster-card {
        padding: 5px;
        border-radius: 22px;
        padding-top: 0px;
    }

    .judgment-tile p {
        font-size: 1.18rem;
    }

    .score-medallion {
        width: 188px;
    }

    .chat-message,
    .auntie-message {
        position: relative;
        grid-template-columns: 1fr;
        gap: 0;
    }

    .chat-avatar,
    .auntie-avatar {
        position: absolute;
        top: 12px;
        left: 13px;
        z-index: 1;
        width: 34px;
        height: 34px;
    }

    .chat-message div,
    .auntie-message div {
        min-height: 58px;
        padding: 9px 10px;
    }

    .chat-message span,
    .auntie-message span {
        min-height: 34px;
        display: flex;
        align-items: center;
        padding-left: 42px;
    }

    .chat-message p,
    .auntie-message p {
        margin-top: 0px;
        font-size: 1rem!important;
    }

    .viral-badge-strip {
        margin: 6px 0;
    }

    .share-surface {
        right: max(10px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .share-icon-button {
        width: 38px;
        height: 38px;
    }

    .share-icon-button img {
        width: 22px;
        height: 22px;
    }

    .create-surface {
        left: max(10px, env(safe-area-inset-left));
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 54px;
        height: 54px;
    }

    .create-surface img {
        width: 43px;
        height: 43px;
    }
}

.admin-shell {
    display: grid;
    gap: 18px;
}

.admin-login-card,
.admin-toolbar,
.admin-judgment-card,
.admin-notice {
    background: rgba(255, 255, 255, 0.94);
    border: 3px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.admin-login-card,
.admin-toolbar,
.admin-judgment-card {
    padding: 12px;
}

.admin-login-card {
    width: min(560px, 100%);
    display: grid;
    gap: 14px;
    justify-self: center;
}

.admin-login-card h1,
.admin-toolbar h1 {
    margin: 8px 0 0;
}

.admin-field {
    display: grid;
    gap: 8px;
}

.admin-field span {
    font-size: 0.74rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-logout {
    display: flex;
}

.admin-toolbar {
    display: grid;
    gap: 10px;
}

.admin-filter-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.admin-filter-tabs a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
    color: var(--ink);
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 999px;
    box-shadow: 3px 3px 0 var(--line);
    font-weight: 1000;
    text-align: center;
    text-decoration: none;
}

.admin-filter-tabs a.is-active {
    background: var(--lemon);
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--line);
}

.admin-filter-tabs strong {
    min-width: 28px;
    min-height: 28px;
    display: grid;
    place-items: center;
    background: var(--mint);
    border: 2px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
}

.admin-notice {
    margin: 0;
    padding: 12px 14px;
    color: var(--ink);
    background: var(--mint);
    font-weight: 1000;
}

.admin-list {
    display: grid;
    gap: 8px;
}

.admin-judgment-card {
    display: grid;
    gap: 8px;
}

.admin-judgment-card.is-hidden-record {
    background: rgba(255, 244, 230, 0.96);
}

.admin-card-head {
    display: grid;
    gap: 10px;
}

.admin-card-head span,
.admin-meta-row span,
.admin-note {
    color: #4d5562;
    font-size: 0.74rem;
    font-weight: 1000;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-card-head h2 {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 4vw, 1.55rem);
    line-height: 1;
}

.admin-card-head strong {
    width: fit-content;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: var(--pink);
    border: 3px solid var(--line);
    border-radius: 999px;
    font-weight: 1000;
}

.admin-judgment-card p {
    margin: 0;
    font-size: 0.94rem;
    font-weight: 850;
    line-height: 1.28;
}

.admin-meta-row,
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-meta-row span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    background: var(--soft);
    border: 2px solid var(--line);
    border-radius: 999px;
}

.admin-note {
    padding: 10px;
    background: var(--lemon);
    border: 2px solid var(--line);
    border-radius: 14px;
}

.admin-actions form {
    display: flex;
    flex: 1 1 220px;
    gap: 8px;
    align-items: center;
}

.admin-actions > a,
.admin-actions > form:not(:first-child) {
    flex: 0 0 auto;
}

.admin-note-input {
    flex: 1 1 140px;
    min-width: 0;
}

.admin-small-button {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    box-shadow: 3px 3px 0 var(--line);
    font-size: 0.86rem;
}

.danger-button {
    background: var(--tomato);
}

@media (min-width: 760px) {
    .admin-toolbar {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
        align-items: end;
    }

    .admin-card-head {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }
}

@keyframes skeleton-shimmer {
    to {
        transform: translateX(110%);
    }
}

@keyframes result-fill {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes swipe-card-hint {
    0%, 100% {
        transform: translate(0, 0) rotate(var(--stack-rotation, 0deg));
    }
    18% {
        transform: translate(34px, -2px) rotate(calc(var(--stack-rotation, 0deg) + 5deg));
    }
    36% {
        transform: translate(0, 0) rotate(var(--stack-rotation, 0deg));
    }
    54% {
        transform: translate(-34px, -2px) rotate(calc(var(--stack-rotation, 0deg) - 5deg));
    }
    72% {
        transform: translate(0, 0) rotate(var(--stack-rotation, 0deg));
    }
}

@keyframes seal-drop {
    from {
        opacity: 0;
        transform: translateY(-18px) rotate(-14deg) scale(0.82);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(-5deg) scale(1);
    }
}

@keyframes sticker-pop {
    from {
        opacity: 0;
        transform: rotate(2deg) scale(0.94);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes badge-cycle {
    0% {
        opacity: 0;
        transform: translateX(24px) scale(0.96);
    }
    8%, 29% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    37%, 100% {
        opacity: 0;
        transform: translateX(-24px) scale(0.96);
    }
}

@keyframes message-slide {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes order-stamp {
    from {
        opacity: 0;
        transform: rotate(-3deg) scale(1.08);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}
