:root {
    --ink: #273432;
    --muted: #687773;
    --line: #dbe8e3;
    --mint: #76cdb0;
    --mint-dark: #2f8f70;
    --mint-soft: #edf8f3;
    --paper: #fffefb;
    --off-white: #fafbf7;
    --yellow: #f2c94c;
    --coral: #ef806e;
    --blue: #4f7fc1;
    --purple: #7755a2;
    --red: #d94b3d;
    --shadow: 0 18px 48px rgba(48, 91, 78, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    background: #fff;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fbfdfb;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.7;
}

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

button {
    color: inherit;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.site-header,
.site-footer,
.color-page {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-header {
    min-height: 70px;
}

.site-logo {
    color: var(--mint-dark);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 0.86rem;
}

.site-nav a,
.site-footer a {
    text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover {
    color: var(--mint-dark);
}

.color-page {
    margin-bottom: 64px;
}

.color-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
    min-height: 360px;
    padding: 28px 0 38px;
}

.series-label {
    margin: 0 0 12px;
    color: var(--mint-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.hero-copy h1 {
    margin: 0;
    font-size: 40px;
    line-height: 1.18;
    letter-spacing: 0;
}

.hero-title-line {
    display: block;
}

.hero-copy > p:last-child {
    max-width: 620px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.paint-preview {
    position: relative;
    min-height: 245px;
    border: 1px solid #e3eee9;
    border-radius: 8px;
    background: #fffefb;
    box-shadow: 0 16px 38px rgba(48, 91, 78, 0.09);
    overflow: hidden;
}

.paint-preview::before {
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 38px;
    height: 2px;
    background: #e2ebe7;
    content: "";
}

.paint-drop {
    position: absolute;
    top: 34px;
    width: 45px;
    height: 58px;
    border: 3px solid rgba(39, 52, 50, 0.14);
    border-radius: 50% 50% 52% 48% / 40% 40% 60% 60%;
    transform: rotate(45deg);
}

.drop-red {
    left: 17%;
    background: #d94b3d;
}

.drop-yellow {
    left: calc(50% - 22px);
    background: #f2c94c;
}

.drop-blue {
    right: 17%;
    background: #315fa8;
}

.paint-bowl {
    position: absolute;
    left: 50%;
    bottom: 36px;
    width: min(62%, 250px);
    height: 92px;
    border: 5px solid #53635e;
    border-top-width: 9px;
    border-radius: 50% 50% 44% 44% / 20% 20% 78% 78%;
    background: #eaa26a;
    box-shadow: inset 0 18px 0 rgba(255, 255, 255, 0.32);
    transform: translateX(-50%);
}

.paint-bowl i {
    position: absolute;
    left: 50%;
    top: -20px;
    width: 76%;
    height: 28px;
    border: 3px solid #53635e;
    border-radius: 50%;
    background: #9e7c9c;
    transform: translateX(-50%);
}

.game-shell {
    position: relative;
    margin-top: 10px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.game-fullscreen-open,
.game-fullscreen-close {
    min-height: 40px;
    padding: 7px 15px;
    border: 1px solid #b9d8cc;
    border-radius: 6px;
    background: #fff;
    color: var(--mint-dark);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
}

.mobile-play-note {
    margin: 10px 0 18px;
    color: var(--muted);
    font-size: 0.84rem;
}

.difficulty-panel {
    margin-bottom: 18px;
}

.section-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.section-heading p,
.section-heading h2 {
    margin: 0;
}

.section-heading p {
    color: var(--mint-dark);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.section-heading h2 {
    font-size: 1rem;
    letter-spacing: 0;
}

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

.difficulty-grid button {
    display: grid;
    align-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 84px;
    padding: 9px 6px;
    border: 1px solid #d7e5df;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    text-align: center;
}

.difficulty-grid button:hover:not(:disabled) {
    border-color: #7abda5;
    background: #f5fbf8;
}

.difficulty-grid button[aria-pressed="true"] {
    border-color: var(--mint-dark);
    background: var(--mint-soft);
    box-shadow: inset 0 0 0 1px var(--mint-dark);
}

.difficulty-grid button:disabled {
    cursor: default;
    opacity: 0.62;
}

.difficulty-grid strong {
    font-size: 0.9rem;
}

.difficulty-grid span,
.difficulty-grid small {
    display: block;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.status-panel {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fbf9;
}

.status-panel > div {
    min-width: 0;
    padding: 9px 6px;
    text-align: center;
}

.status-panel > div + div {
    border-left: 1px solid var(--line);
}

.status-panel span,
.status-panel strong {
    display: block;
}

.status-panel span {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
}

.status-panel strong {
    font-size: 1.05rem;
    line-height: 1.35;
}

.mix-stage {
    position: relative;
    padding: 18px;
    border: 1px solid #d8e6e1;
    border-radius: 8px;
    background: #f7fbf8;
    overflow: clip;
}

.stage-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 28px;
    margin-bottom: 10px;
}

.stage-heading p {
    margin: 0;
}

.stage-progress {
    font-weight: 900;
}

.stage-difficulty {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.color-comparison {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 210px;
    padding: 16px;
    border: 1px solid #dce8e3;
    border-radius: 8px;
    background: #fffefb;
}

.color-sample {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
}

.color-sample span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.color-sample i {
    display: block;
    width: clamp(76px, 10vw, 118px);
    aspect-ratio: 1;
    border: 5px solid #fff;
    border-radius: 50%;
    background: #f4f1e8;
    box-shadow: 0 0 0 1px #c9d8d2, 0 9px 20px rgba(40, 70, 62, 0.12);
}

.mix-bowl {
    position: relative;
    width: 184px;
    height: 122px;
    margin-inline: auto;
}

.bowl-rim,
.mix-bowl > i {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.bowl-rim {
    z-index: 2;
    top: 4px;
    width: 172px;
    height: 50px;
    border: 5px solid #53635e;
    border-radius: 50%;
    background: #fff;
}

.mix-bowl > i {
    z-index: 3;
    top: 12px;
    width: 148px;
    height: 34px;
    border: 2px solid rgba(39, 52, 50, 0.18);
    border-radius: 50%;
    background: #f4f1e8;
    transition: background-color 180ms ease;
}

.mix-bowl::after {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 0;
    width: 172px;
    height: 96px;
    border: 5px solid #53635e;
    border-top: 0;
    border-radius: 0 0 52% 52% / 0 0 74% 74%;
    background: #edf4f1;
    content: "";
    transform: translateX(-50%);
}

.bowl-shine {
    position: absolute;
    z-index: 4;
    left: 52px;
    top: 18px;
    width: 36px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(-8deg);
}

.mix-status {
    display: grid;
    grid-template-columns: 0.75fr 0.75fr 2.5fr;
    margin-top: 12px;
    border: 1px solid #d7e5df;
    border-radius: 6px;
    background: #fff;
}

.mix-status > span {
    min-width: 0;
    min-height: 48px;
    padding: 11px 12px;
    color: var(--muted);
    font-size: 0.82rem;
}

.mix-status > span + span {
    border-left: 1px solid #d7e5df;
}

.mix-status strong {
    color: var(--ink);
}

.seed-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.seed-button {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 8px;
    min-width: 0;
    min-height: 64px;
    padding: 8px;
    border: 1px solid #d5e2dd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    text-align: left;
}

.seed-button:hover:not(:disabled) {
    border-color: var(--mint-dark);
    background: #f6fbf8;
}

.seed-button:disabled {
    cursor: default;
    opacity: 0.48;
}

.seed-button.is-used {
    border-color: #74b79f;
    background: #eff9f5;
}

.seed-swatch {
    grid-row: 1 / 3;
    width: 32px;
    height: 40px;
    border: 2px solid rgba(39, 52, 50, 0.2);
    border-radius: 50% 50% 52% 48% / 40% 40% 60% 60%;
    background: var(--seed-color);
    transform: rotate(18deg);
}

.seed-button strong,
.seed-button small {
    min-width: 0;
    line-height: 1.3;
}

.seed-button strong {
    font-size: 0.88rem;
}

.seed-button small {
    color: var(--muted);
    font-size: 0.68rem;
}

.seed-count {
    position: absolute;
    right: 5px;
    top: 5px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 0.7rem;
}

.mix-actions,
.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.mix-actions {
    margin-top: 14px;
}

.control-row {
    margin-top: 16px;
}

.ghost-button,
.judge-button,
.primary-button {
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 900;
}

.ghost-button {
    border: 1px solid #bcd3ca;
    background: #fff;
}

.ghost-button:hover:not(:disabled) {
    background: #f1f8f5;
}

.judge-button,
.primary-button {
    border: 1px solid #267b60;
    background: var(--mint-dark);
    color: #fff;
}

.judge-button {
    min-width: 150px;
}

.judge-button:hover:not(:disabled),
.primary-button:hover:not(:disabled) {
    background: #26795f;
}

.ghost-button:disabled,
.judge-button:disabled,
.primary-button:disabled {
    cursor: default;
    opacity: 0.5;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #f0b836;
    outline-offset: 3px;
}

.judgement-area {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    min-height: 86px;
    margin-top: 12px;
    text-align: center;
}

.judgement-text {
    font-size: 1.55rem;
    line-height: 1.2;
}

.judgement-detail,
.answer-recipe {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.answer-recipe {
    color: var(--ink);
    font-weight: 700;
}

.stage-message {
    min-height: 28px;
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    text-align: center;
}

.judgement-perfect .judgement-text {
    color: #247959;
}

.judgement-good .judgement-text {
    color: #356fa9;
}

.judgement-miss .judgement-text {
    color: #c04f45;
}

.judgement-perfect .mix-bowl {
    animation: bowl-perfect 520ms ease both;
}

.judgement-good .mix-bowl {
    animation: bowl-good 480ms ease both;
}

.judgement-miss .mix-bowl {
    animation: bowl-miss 380ms ease both;
}

@keyframes bowl-perfect {
    0%,
    100% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.08) rotate(-2deg);
    }
    70% {
        transform: scale(1.03) rotate(2deg);
    }
}

@keyframes bowl-good {
    0%,
    100% {
        transform: translateY(0);
    }
    55% {
        transform: translateY(-8px);
    }
}

@keyframes bowl-miss {
    0%,
    100% {
        transform: translateX(0);
    }
    30% {
        transform: translateX(-6px);
    }
    65% {
        transform: translateX(6px);
    }
}

.stage-announcement {
    position: absolute;
    z-index: 12;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 254, 251, 0.9);
    color: var(--ink);
    font-size: clamp(2rem, 6vw, 4.4rem);
    font-weight: 950;
}

.center-result {
    position: absolute;
    z-index: 14;
    left: 50%;
    top: 50%;
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 4px 16px;
    width: min(420px, calc(100% - 28px));
    padding: 20px;
    border: 2px solid var(--mint-dark);
    border-radius: 8px;
    background: rgba(255, 254, 251, 0.97);
    box-shadow: 0 20px 50px rgba(39, 52, 50, 0.2);
    text-align: center;
    transform: translate(-50%, -50%);
}

.center-result > strong,
.center-score {
    grid-column: 1 / -1;
}

.center-result > strong {
    font-size: 1.15rem;
}

.center-score {
    color: var(--mint-dark);
    font-size: 1rem;
}

.center-score b {
    font-size: 2rem;
}

.result-panel {
    margin-top: 16px;
    padding: 18px;
    border-left: 5px solid var(--mint);
    background: #f6faf8;
}

.result-panel h2,
.result-panel p {
    margin: 0;
}

.result-panel h2 {
    font-size: 1.12rem;
}

.result-panel p {
    margin-top: 5px;
    color: var(--muted);
}

.replay-button {
    margin-top: 12px;
}

.log-title {
    margin: 18px 0 8px;
    font-size: 1rem;
}

.log-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.log-list li {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid #dce7e3;
    border-left-width: 4px;
    border-radius: 5px;
    background: #fff;
}

.log-list strong,
.log-list span,
.log-list small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.log-list span,
.log-list small {
    color: var(--muted);
    font-size: 0.76rem;
}

.log-perfect {
    border-left-color: #2f9770 !important;
}

.log-good {
    border-left-color: #4f8fc9 !important;
}

.log-miss {
    border-left-color: #d95f57 !important;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 32px;
    margin-top: 34px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}

.info-section article {
    min-width: 0;
}

.info-section h2 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.info-section p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.info-section a {
    color: var(--mint-dark);
    font-weight: 800;
}

.comments-stub {
    margin-top: 30px;
    padding: 18px;
    border: 1px dashed #bfd7ce;
    border-radius: 6px;
    background: #f8fbf9;
}

.comments-stub h2,
.comments-stub p {
    margin: 0;
}

.comments-stub p {
    margin-top: 4px;
    color: var(--muted);
}

.site-footer {
    min-height: 86px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 920px) {
    .color-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .paint-preview {
        min-height: 220px;
    }

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

    .info-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header,
    .site-footer,
    .color-page {
        width: min(100% - 24px, 1120px);
    }

    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding-block: 14px;
    }

    .color-hero {
        gap: 22px;
        padding: 18px 0 28px;
    }

    .hero-copy h1 {
        font-size: 28px;
    }

    .hero-copy > p:last-child {
        font-size: 0.96rem;
    }

    .paint-preview {
        min-height: 190px;
    }

    .paint-drop {
        top: 24px;
        width: 34px;
        height: 46px;
    }

    .paint-bowl {
        bottom: 26px;
        height: 76px;
    }

    .game-shell {
        padding: 14px;
    }

    .difficulty-grid button {
        min-height: 78px;
        padding: 7px 4px;
    }

    .difficulty-grid strong {
        font-size: 0.82rem;
    }

    .difficulty-grid span,
    .difficulty-grid small {
        font-size: 0.66rem;
    }

    .status-panel span {
        font-size: 0.58rem;
    }

    .status-panel strong {
        font-size: 0.88rem;
    }

    .mix-stage {
        padding: 12px;
    }

    .stage-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    .color-comparison {
        grid-template-columns: minmax(0, 1fr) 122px minmax(0, 1fr);
        gap: 6px;
        min-height: 158px;
        padding: 10px 5px;
        background: #fffefb;
    }

    .color-sample {
        gap: 5px;
    }

    .color-sample span {
        font-size: 0.68rem;
    }

    .color-sample i {
        width: clamp(54px, 18vw, 74px);
        border-width: 3px;
    }

    .mix-bowl {
        width: 118px;
        height: 86px;
    }

    .bowl-rim {
        width: 112px;
        height: 36px;
        border-width: 4px;
    }

    .mix-bowl > i {
        top: 10px;
        width: 94px;
        height: 24px;
    }

    .mix-bowl::after {
        width: 112px;
        height: 68px;
        border-width: 4px;
        border-top: 0;
    }

    .bowl-shine {
        left: 34px;
        top: 14px;
        width: 22px;
        height: 5px;
    }

    .mix-status {
        grid-template-columns: 1fr 1fr;
    }

    .mix-status > span {
        min-height: 44px;
        padding: 9px;
        font-size: 0.76rem;
    }

    .mix-status > span:nth-child(3) {
        grid-column: 1 / -1;
        border-top: 1px solid #d7e5df;
        border-left: 0;
    }

    .seed-grid {
        gap: 6px;
    }

    .seed-button {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 34px auto auto;
        justify-items: center;
        gap: 1px;
        min-height: 78px;
        padding: 6px 2px;
        text-align: center;
    }

    .seed-swatch {
        grid-row: auto;
        width: 26px;
        height: 33px;
    }

    .seed-button strong {
        font-size: 0.76rem;
    }

    .seed-button small {
        font-size: 0.58rem;
    }

    .seed-count {
        right: 2px;
        top: 2px;
        width: 19px;
        height: 19px;
        font-size: 0.62rem;
    }

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

    .mix-actions .judge-button {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .mix-actions .ghost-button {
        min-width: 0;
        padding-inline: 6px;
    }

    .judgement-area {
        min-height: 98px;
    }

    .judgement-text {
        font-size: 1.35rem;
    }

    .judgement-detail,
    .answer-recipe,
    .stage-message {
        font-size: 0.78rem;
    }

    .center-result {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2px 4px;
        padding: 10px;
    }

    .center-result > strong,
    .center-score {
        grid-column: 1 / -1;
    }

    .center-result > span:not(.center-score) {
        font-size: .72rem;
        white-space: nowrap;
    }

    .center-score b {
        font-size: 1.65rem;
    }

    .log-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .site-header,
    .site-footer,
    .color-page {
        width: min(100% - 20px, 1120px);
    }

    .hero-copy h1 {
        font-size: 27px;
    }

    .game-shell {
        padding: 10px;
    }

    .difficulty-grid {
        gap: 5px;
    }

    .difficulty-grid button {
        min-height: 76px;
    }

    .status-panel > div {
        padding-inline: 2px;
    }

    .mix-stage {
        padding: 9px;
    }

    .color-comparison {
        grid-template-columns: minmax(0, 1fr) 108px minmax(0, 1fr);
    }

    .mix-bowl {
        width: 104px;
    }

    .bowl-rim,
    .mix-bowl::after {
        width: 100px;
    }

    .mix-bowl > i {
        width: 84px;
    }

    .seed-grid {
        gap: 4px;
    }

    .seed-button {
        min-height: 76px;
    }

    .mix-actions,
    .control-row {
        gap: 6px;
    }

    .ghost-button,
    .judge-button,
    .primary-button {
        padding-inline: 10px;
    }
}
