/* Color Harmony: selection → clear → gravity, without replacing stationary tiles. */
.color-instruction,.color-scores,.color-steps,.color-status,.color-actions{max-width:420px;margin-left:auto;margin-right:auto}
.color-scores{display:grid;grid-template-columns:1fr 1.35fr 1fr;gap:8px;margin-bottom:15px}
.color-scores>div{position:relative;text-align:center;border:1px solid #e9e4f5;border-radius:14px;background:#f7f4fe;padding:11px 6px}
.color-scores small{display:block;font-size:10px;color:#807491;font-weight:700}
.color-scores strong{display:block;font-size:25px;line-height:1.3;color:#5e468a;margin-top:4px;font-variant-numeric:tabular-nums}
.color-scores strong span{font-size:12px;font-weight:600;color:#a197b0}
#colorGain{position:absolute;right:12px;top:20px;opacity:0;pointer-events:none;color:#6b50c8;font-size:18px}
.color-gain{animation:color-gain 750ms ease-out both}
.color-steps{display:flex;justify-content:space-between;gap:5px;padding:0;list-style:none;margin-top:0;margin-bottom:12px;font-size:10px;color:#8a8199}
.color-steps li{display:flex;align-items:center;gap:6px;transition:color .15s}
.color-steps li>b{display:grid;place-items:center;width:20px;height:20px;border-radius:7px;background:#eeebf4;color:#a196b0;font-size:10px}
.color-steps .is-current{color:#654bb5;font-weight:800}.color-steps .is-current>b{background:#7559cd;color:white}
.board.color-board{position:relative;display:block;width:100%;aspect-ratio:1;max-width:420px;padding:10px;border-radius:19px;background:linear-gradient(145deg,#e4ddef,#d8d0e6);box-shadow:inset 0 2px 2px #fff9,0 9px 24px #5f447c12;overflow:hidden;isolation:isolate;touch-action:manipulation}
.color-slots{position:absolute;inset:10px;display:grid;grid-template-columns:repeat(6,1fr);gap:8px;pointer-events:none}
.color-slots i{border-radius:11px;background:#f4f0f99c;box-shadow:inset 0 2px 4px #64517e10}
.color-layer{position:absolute;inset:10px}
.board.color-board .color-tile{position:absolute;left:calc(var(--x) * (100% + 8px) / 6);top:calc(var(--y) * (100% + 8px) / 6);width:calc((100% - 40px) / 6);height:calc((100% - 40px) / 6);min-height:0;padding:0;display:grid;place-items:center;border-radius:11px;background:var(--color);border:1px solid #ffffff50;box-shadow:inset 2px 2px 4px #ffffff80,inset -2px -4px 4px #00000014,0 2px 3px #66507812;transition:filter 120ms,box-shadow 120ms;z-index:1}
.color-tile>span{font-size:clamp(13px,3.5vw,20px);font-weight:400;color:#35264165;text-shadow:0 1px #ffffff50;pointer-events:none}
.board.color-board .color-tile:active{transform:none}.color-tile:focus-visible{outline:3px solid #473168;outline-offset:-4px;z-index:4}
.board.color-board .color-preview,.board.color-board .color-hint{box-shadow:inset 0 0 0 3px #fff,0 0 0 2px #6b548d65;filter:brightness(1.1);z-index:3}
.board.color-board .color-hint>span{color:#493066}
.board.color-board .color-selected{animation:color-select 25ms ease both;box-shadow:inset 0 0 0 3px #fff,0 0 14px #fff9;z-index:4}
.board.color-board .color-clearing{animation:color-clear 70ms ease-in both}
.board.color-board .color-invalid{animation:color-no-pair 200ms ease}
.board.color-board .color-refresh{animation:color-refresh 100ms ease both}
.color-board[aria-busy=true] .color-tile{cursor:wait}
.color-burst{position:absolute;transform:translate(-50%,-50%);z-index:6;background:#fff6d7;color:#634a1c;box-shadow:0 4px 15px #59422c35;border:2px solid white;border-radius:15px;padding:6px 13px;font-weight:900;font-size:24px;opacity:0;pointer-events:none}
.color-burst.is-visible{animation:color-burst 700ms ease-out both}
.color-status{min-height:40px;display:flex;align-items:center;justify-content:center;text-align:center;color:#746186;font-size:11px;line-height:1.6;padding:8px 6px;margin-top:7px;margin-bottom:0;font-variant-numeric:tabular-nums}
.color-actions{margin-top:10px;display:grid;grid-template-columns:1fr 1fr}.color-actions button{min-width:0;white-space:normal}
@keyframes color-select{50%{transform:scale(1.06);filter:brightness(1.2)}100%{transform:scale(1.02)}}
@keyframes color-clear{0%{transform:scale(1.02);opacity:1}35%{transform:scale(1.1);filter:brightness(1.4)}100%{transform:scale(.15);opacity:0}}
@keyframes color-no-pair{25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}
@keyframes color-refresh{50%{transform:scale(.7);opacity:.2}}
@keyframes color-burst{0%{opacity:0;transform:translate(-50%,-40%) scale(.65)}20%,70%{opacity:1;transform:translate(-50%,-60%) scale(1)}100%{opacity:0;transform:translate(-50%,-95%) scale(.95)}}
@keyframes color-gain{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-35px)}}
@media(max-width:400px){.color-steps{font-size:9px}.color-scores small{font-size:9px}.color-scores strong{font-size:22px}.color-actions button{font-size:10px;padding:11px 7px}}
@media(prefers-reduced-motion:reduce){.color-board .color-tile,.color-burst.is-visible,.color-gain{animation:none!important;transition:none!important}.color-tile.color-clearing{opacity:0}.color-burst.is-visible{opacity:1}.color-steps li{transition:none}}

.color-mode-options{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:22px 0}
.color-mode-options button{display:flex;flex-direction:column;gap:8px;align-items:flex-start;text-align:left;padding:18px;border:1px solid #e6e1f0;border-radius:16px;background:#faf9fd;color:#6d6080;min-height:150px}
.color-mode-options .chosen{background:#f0ebff;border-color:#9f88d5;box-shadow:0 0 0 2px #ab97d41c}.color-mode-options span{font-size:26px;color:#856ac4}.color-mode-options b{font-size:14px}.color-mode-options small{font-size:11px;line-height:1.65}
.color-launch-label{font-size:13px;margin:24px 0 14px;color:#766887}.color-rule-card{padding:16px 19px;border:1px solid #e7e1f2;border-radius:14px;background:#f9f7fc;font-size:12px;line-height:1.9;color:#746482;margin:20px 0}.color-rule-card b{color:#5a4576}
.color-run-heading,.color-goal{max-width:420px;margin:0 auto 13px}.color-run-heading{display:flex;justify-content:space-between;gap:10px;font-size:11px;color:#6f5d8c}.color-run-heading span{color:#a096af;font-size:10px}.color-goal>div{display:flex;justify-content:space-between;gap:10px;font-size:11px;color:#7d6b91;margin-bottom:8px}.color-goal progress{display:block;width:100%;height:9px;border:0;border-radius:20px;overflow:hidden;background:#eee9f6;accent-color:#8870cc}.color-goal progress::-webkit-progress-bar{background:#eee9f6}.color-goal progress::-webkit-progress-value{background:linear-gradient(90deg,#a58ae3,#7fbfa9);border-radius:20px;transition:width 120ms}.color-collect{grid-column:1/-1}.color-result-caption{padding:15px 20px;background:#f3eefb;border-radius:14px;color:#665080;display:flex;flex-direction:column;gap:7px;text-align:center}.color-result-caption span{font-size:11px}.color-stage-win{text-align:center;padding:22px 10px}.color-stage-win>span{display:block;font-size:60px;color:#9a7acc}.color-stage-win>small{color:#a08db5}.color-stage-win>p{color:#8a759d}.color-stage-win>strong{display:block;color:#705486}.color-stage-win>button{margin:5px;padding:12px 17px;border-radius:12px;border:1px solid #ddd3ec}.color-stage-win .color-rule-card{max-width:420px;margin:22px auto}
@media(max-width:480px){.color-mode-options{gap:7px}.color-mode-options button{padding:12px 9px;min-height:145px}.color-mode-options b{font-size:12px}.color-mode-options small{font-size:10px}.color-rule-card{padding:13px;font-size:11px}.color-run-heading{font-size:10px}}
