:root {
    --c: #3d8bf2;
    --on-c: #fff;
    --ink: #1f1d1b;
    --muted: #706a64;
    --line: #ebe8e4;
    --soft: #f7f6f4;
    --ng: #e5484d;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: "Zen Kaku Gothic New", "Yu Gothic", "Meiryo", sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.6;
}

.wrap {
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 16px 16px;
}

/* header */
.top {
    margin-bottom: 24px;
    text-align: center;
}

.top h1 {
    font-weight: 500;
    font-size: clamp(36px, 8vw, 56px);
    line-height: 1.1;
    margin: 0;
    letter-spacing: .02em;
}

.top h1 span {
    color: var(--c);
}

.top p {
    margin: 12px auto 0;
    color: var(--muted);
    max-width: 640px;
}

/* panels */
.panel {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 22px;
    padding: 22px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
}

h2 {
    font-weight: 500;
    font-size: 24px;
    margin: 2px 0 6px;
    line-height: 1.3;
}

input[type=text] {
    font: inherit;
    font-size: 19px;
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--soft);
    color: var(--ink);
}

input[type=text]:focus {
    border-color: var(--c);
    background: #fff;
    outline: none;
}

button {
    font: inherit;
    cursor: pointer;
    color: var(--ink);
}

:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

/* color picker */
.picker {
    display: grid;
    gap: 18px;
}

@media (min-width: 640px) {
    .picker {
        grid-template-columns: minmax(0, 1fr) 220px;
        align-items: center;
    }
}

.picker-main {
    display: grid;
    gap: 10px;
}

.field-label {
    display: grid;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
}

.picker-main .field-label+.field-label {
    margin-top: 8px;
}

.tones,
.roles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    border-radius: 14px;
    border: 2px solid var(--line);
    background: #fff;
    font-weight: 500;
    font-size: 15px;
}

.tone[aria-pressed=true] {
    border-color: var(--ink);
    box-shadow: 0 2px 0 var(--ink);
}

.tones {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.tone-dot {
    width: 48px;
    height: 48px;
    padding: 3px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: none;
}

.tone-dot[aria-pressed=true] {
    border-color: var(--ink);
}

.tone-swatch {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

#hue {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 22px;
    margin: 0;
    border-radius: 999px;
    background: linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

#hue::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--hue-c, #fff);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
}

#hue::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--hue-c, #fff);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .45);
}

.preview-jars {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.preview-jars canvas {
    width: 64px;
    height: 116px;
}

/* interest items */
.items {
    display: grid;
    gap: 10px;
}

@media (min-width: 760px) {
    .items {
        grid-template-columns: 1fr 1fr;
    }
}

.item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 10px 14px 10px 10px;
    border-radius: 16px;
    background: var(--soft);
}

.item .mini {
    width: 64px;
    height: 116px;
}

.item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.item-name {
    font-weight: 500;
    font-size: 18px;
    line-height: 1.3;
}

.pill {
    flex: none;
    font-size: 13px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    border: 1.5px solid var(--line);
    white-space: nowrap;
}

.pill[data-level="0"] {
    background: var(--c);
    border-color: var(--c);
    color: var(--on-c);
}

.pill[data-level="2"] {
    background: color-mix(in srgb, var(--c) 18%, #fff);
    border-color: transparent;
    color: var(--ink);
}

.pill[data-level="3"] {
    background: color-mix(in srgb, var(--c) 40%, #fff);
    border-color: transparent;
    color: var(--ink);
}

.pill[data-level="4"] {
    background: color-mix(in srgb, var(--c) 70%, #fff);
    border-color: transparent;
    color: var(--ink);
}

.pill[data-level="5"] {
    background: var(--c);
    border-color: var(--c);
    color: var(--on-c);
}

.level {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 10px;
    margin: 8px 0;
    border-radius: 999px;
    background: linear-gradient(to right, var(--c) 0 var(--pct, 0%), #e2ded9 var(--pct, 0%) 100%);
}

.level::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--ink);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
    cursor: grab;
}

.level::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--ink);
    cursor: grab;
}

.ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 11px;
    margin-top: 4px;
}

.ticks i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #cfcac4;
}

.ends {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* actions + result */
.actions {
    display: grid;
    justify-items: center;
    gap: 30px;
    margin: 28px 0;
}

.big {
    display: block;
    width: 100%;
    max-width: 420px;
    padding: 16px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--c);
    color: var(--on-c);
    font-weight: 500;
    font-size: 22px;
    text-align: center;
    text-decoration: none;
    letter-spacing: .06em;
    box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 60%, #000);
    transition: transform .08s, box-shadow .08s;
}

.big:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 60%, #000);
}

.big:disabled {
    opacity: .6;
    cursor: wait;
}

.linkbtn {
    background: none;
    border: 0;
    padding: 4px;
    text-decoration: underline;
    color: var(--muted);
    font-size: 14px;
}

.result {
    text-align: center;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
}

.result img {
    display: block;
    width: 100%;
    height: auto;
    margin: 8px auto 30px;
    border-radius: 12px;
    border: 1.5px solid var(--line);
}

.result .big {
    margin: 0 auto;
}

.noscript {
    text-align: center;
    color: var(--ng);
}

.site-footer {
    text-align: center;
    margin: 40px 0 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.site-footer p {
    margin: 0 0 6px;
}

.site-footer p:last-child {
    margin-bottom: 0;
}

.site-footer a {
    color: var(--muted);
}

/* creator profile */
#creatorSlotAfterResult {
    display: flex;
    justify-content: center;
    margin: 30px 0 0;
}

.creator-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.creator-lead {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
}

.creator-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    gap: 12px;
    margin: 0 auto;
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--soft);
    border: 1.5px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    box-sizing: border-box;
    transition: border-color .15s, background-color .15s, transform .08s;
}

.creator-card:hover {
    background: #fff;
    border-color: var(--c);
}

.creator-card:active {
    transform: translateY(2px);
}

.creator-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.creator-text {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    letter-spacing: .04em;
}

.creator-main {
    font-weight: 500;
    font-size: 22px;
    color: var(--ink);
    line-height: 1.2;
}

.creator-id {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    font-size: 16px;
    color: var(--muted);
    line-height: 1.2;
}

.creator-id .x-logo {
    display: inline-block;
    margin: 0 2px 0 1px;
    vertical-align: -1px;
}
