@charset "utf-8";
/* ============================================================
    カラーコード変換・コントラスト比
    選んだ色は --swatchColor・--shadeColor・--previewFg/Bg でJSから渡す
    ============================================================ */

/* ▼ 変換 */
.colorLayout{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.25rem;
    align-items: start;
}
.colorSwatch{
    position: relative;
    display: grid;
    place-items: end center;
    aspect-ratio: 4 / 3;
    padding: 1rem;
    border-radius: var(--radiusLg);
    background: var(--swatchColor, var(--accent));
    box-shadow: var(--shadowCard);
    cursor: pointer;
    color: var(--textMain);
    transition: background-color var(--durationFast) ease;
}
.colorSwatch.isDark{
    color: var(--textOnAccent);
}
.colorPicker{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.colorSwatchHint{
    padding: 0.2em 0.9em;
    border-radius: var(--radiusPill);
    background: var(--bgHeader);
    color: var(--textMain);
    font-size: 0.8125rem;
    font-weight: 700;
    pointer-events: none;
}
.colorInputRow{
    display: flex;
    gap: var(--spaceSm);
    align-items: center;
}
.colorInputRow .inputText{
    font-family: var(--fontMono);
}
.shadeList{
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}
.shadeList li{
    margin: 0;
}
.shadeBtn{
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    min-height: 64px;
    padding: 0.3em 0.1em;
    border-radius: var(--radiusSm);
    background: var(--shadeColor);
    color: var(--textMain);
    font-family: var(--fontMono);
    font-size: 0.6875rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.shadeBtn.isDark{
    color: var(--textOnAccent);
}
@media (hover: hover){
    .shadeBtn:hover{
        transform: translateY(-2px);
    }
}
@media (max-width: 719px){
    .shadeList{
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ▼ コントラスト比 */
.contrastSwap{
    margin: var(--spaceMd) 0;
}
.contrastPreview{
    margin-bottom: 1rem;
    padding: 1.25rem;
    border-radius: var(--radiusMd);
    border: 2px solid var(--line);
    background: var(--previewBg, var(--bgCard));
    color: var(--previewFg, var(--textMain));
}
.contrastLarge{
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
}
.contrastNormal{
    font-size: 1rem;
}
.judgePass{
    color: var(--success);
}
.judgeFail{
    color: var(--danger);
}
