/* play/color-war/color-war.css — Color War (EN /play/color-war/ and KO /ko/play/color-war/).
   Loaded after /css/easytest.css and /css/clean-test.css; scoped to body.color-war-page, .cw-* classes. */

body.test-page.color-war-page {
  --cw-ink: #1F1733;
  --cw-mute: #6B6480;
  --cw-text: #3D3550;
  --cw-line: #EEE8FA;
  --cw-line-2: #E7E0F5;
  --cw-accent: #8257E6;
  --cw-accent-dark: #6C3FD4;
  --cw-accent-soft: #F3EFFB;
  --cw-stage: #151022;
  --cw-stage-2: #221a36;
  --cw-hot: #FF6B5E;
  --cw-gold: #F7D774;
  word-break: keep-all;
  overflow-wrap: break-word;
}
html[lang="ko"] body.color-war-page { font-family: 'Noto Sans KR', 'Plus Jakarta Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif; }

.color-war-page [hidden] { display: none !important; }
.color-war-page .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.color-war-page *, .color-war-page *::before, .color-war-page *::after { box-sizing: border-box; }

.cw-shell { width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px 24px; }

.cw-topnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.cw-topnav-links { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.cw-topnav-links a { color: var(--cw-mute); text-decoration: underline; text-underline-offset: 3px; }
.cw-topnav-links a:hover { color: var(--cw-accent); }

.color-war-page .cw-head { text-align: center; margin-bottom: 18px; }
.color-war-page .cw-head h1 { font-size: clamp(1.75rem, 6.4vw, 2.6rem); line-height: 1.15; margin: 4px 0 8px; letter-spacing: -0.03em; }
.color-war-page .cw-head .cw-sub { font-size: 1.02rem; line-height: 1.55; margin: 0 auto 10px; max-width: 34em; }
.cw-watch { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 14px; }
.cw-watch a { color: var(--cw-accent-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---- cards ---- */
.cw-card { background: #fff; border: 1px solid #F1ECF9; border-radius: 18px; box-shadow: 0 18px 40px rgba(130, 87, 230, 0.12); padding: 20px; margin-bottom: 20px; }
.cw-card h2 { font-size: 1.3rem; margin: 0 0 14px; }
.cw-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cw-label { font-weight: 800; color: var(--cw-ink); }

.cw-stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--cw-accent-soft); border-radius: 999px; padding: 4px; }
.cw-stepper button { width: 44px; height: 44px; border-radius: 999px; border: 0; background: #fff; color: var(--cw-accent-dark); font-size: 1.4rem; font-weight: 800; cursor: pointer; box-shadow: 0 2px 6px rgba(130, 87, 230, .15); }
.cw-stepper button:disabled { opacity: .35; cursor: default; }
.cw-stepper output { min-width: 2.2em; text-align: center; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cw-ink); }

.cw-names { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.cw-names li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cw-chip { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--c, #ccc); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); }
body.test-page .cw-names input[type="text"] { flex: 1; min-width: 0; width: 100%; height: 42px; padding: 8px 10px; border-radius: 12px; font-size: 16px; font-family: inherit; }

.cw-scale { border: 0; margin: 0 0 6px; padding: 0; min-width: 0; }
.cw-scale legend { font-weight: 800; color: var(--cw-ink); margin-bottom: 8px; padding: 0; }
.cw-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--cw-accent-soft); border-radius: 14px; padding: 4px; }
.cw-seg label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 4px; border-radius: 11px; cursor: pointer; text-align: center; color: var(--cw-text); }
.cw-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cw-seg strong { font-size: .98rem; }
.cw-seg small { font-size: .78rem; color: var(--cw-mute); font-variant-numeric: tabular-nums; }
.cw-seg label:has(input:checked) { background: #fff; color: var(--cw-accent-dark); box-shadow: 0 3px 10px rgba(130, 87, 230, .18); }
.cw-seg label:has(input:focus-visible) { outline: 3px solid #A98BF0; outline-offset: 1px; }
.cw-hint { font-size: .86rem; color: var(--cw-mute); margin: 6px 0 14px; }

.cw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cw-switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--cw-ink); cursor: pointer; min-height: 44px; }
.cw-switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #D9D2EA; position: relative; cursor: pointer; margin: 0; transition: background .15s; }
.cw-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.cw-switch input:checked { background: var(--cw-accent); }
.cw-switch input:checked::after { transform: translateX(18px); }
.cw-switch input:focus-visible { outline: 3px solid #A98BF0; outline-offset: 2px; }

.cw-shared { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; background: #FFF8E1; border: 1px solid #F6E3A6; border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; font-size: .92rem; color: var(--cw-text); }

.cw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 1rem; font-family: inherit; cursor: pointer; border: 1.5px solid transparent; text-decoration: none; line-height: 1.2; }
.cw-btn-primary { background: var(--cw-accent); color: #fff; box-shadow: 0 10px 22px rgba(130, 87, 230, .28); }
.cw-btn-primary:hover { background: var(--cw-accent-dark); }
.cw-btn-ghost { background: #fff; color: var(--cw-accent-dark); border-color: var(--cw-line-2); }
.cw-btn-ghost:hover { background: var(--cw-accent-soft); }
.cw-btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--cw-accent-dark); text-decoration: underline; font-weight: 700; font-size: .92rem; cursor: pointer; font-family: inherit; }
.cw-btn:focus-visible, .cw-btn-link:focus-visible, .cw-stepper button:focus-visible { outline: 3px solid #A98BF0; outline-offset: 2px; }
.cw-start { width: 100%; font-size: 1.15rem; min-height: 54px; }

/* ---- stage (the battle) ---- */
.cw-stage { background: var(--cw-stage); border-radius: 20px; padding: 12px 12px 10px; margin-bottom: 20px; color: #fff; box-shadow: 0 18px 40px rgba(31, 23, 51, .28); scroll-margin-top: 8px; }
.cw-countdown { margin: 2px 0 8px; min-height: 1.5em; text-align: center; font-size: clamp(1rem, 4.4vw, 1.3rem); font-weight: 800; letter-spacing: .01em; color: #fff; font-variant-numeric: tabular-nums; }
.cw-countdown.is-hot { color: var(--cw-hot); }
.cw-countdown.is-done { color: var(--cw-gold); }
.cw-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #3b3a4a; margin: 0 auto 10px; max-width: 560px; }
.cw-seg-bar { display: block; height: 100%; flex: none; }
.cw-seg-bar.is-danger { box-shadow: inset 0 0 0 3px #fff; }
.cw-canvas-wrap { width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: #0d0a16; }
.cw-canvas-wrap canvas { display: block; width: 100%; height: 100%; }
.cw-legend { list-style: none; margin: 10px auto 0; padding: 0; max-width: 560px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; font-size: .9rem; }
/* easytest.css greys every `body.test-page ul li`; the legend sits on the dark stage. */
body.test-page .cw-legend .cw-leg { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 3px 6px; border-radius: 8px; color: #F2EEFB; }
.cw-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--c, #888); }
.cw-leg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.cw-leg-pct { flex: none; font-variant-numeric: tabular-nums; color: #CFC8E3; font-size: .85rem; }
.cw-leg.is-danger { background: rgba(255, 107, 94, .18); }
.cw-leg.is-danger .cw-leg-pct { color: var(--cw-hot); font-weight: 800; }
.cw-leg.is-out { opacity: .5; }
.cw-leg.is-out .cw-leg-name { text-decoration: line-through; }
.cw-leg.is-winner { background: rgba(247, 215, 116, .16); }
.cw-leg.is-winner .cw-leg-pct { color: var(--cw-gold); font-weight: 800; }
.cw-stage-tools { display: flex; justify-content: flex-end; gap: 8px; margin: 10px auto 0; max-width: 560px; }
.cw-stage-tools button { min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid #3F3557; background: var(--cw-stage-2); color: #E8E3F5; font-weight: 700; font-size: .85rem; font-family: inherit; cursor: pointer; }
.cw-stage-tools button:hover { background: #2d2347; }
.cw-stage-tools button:focus-visible { outline: 3px solid #A98BF0; outline-offset: 2px; }

/* ---- result ---- */
.cw-result { scroll-margin-top: 8px; }
.cw-kicker { margin: 0 0 4px; font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cw-accent); }
.color-war-page .cw-winner { display: flex; align-items: center; gap: 10px; font-size: clamp(1.5rem, 6vw, 2.1rem); line-height: 1.2; margin: 0 0 6px; outline: none; }
.cw-winner .cw-chip { width: 30px; height: 30px; }
.cw-winner span:last-child { min-width: 0; overflow-wrap: anywhere; }
.cw-final { margin: 0 0 14px; color: var(--cw-mute); font-variant-numeric: tabular-nums; }
.color-war-page .cw-result h3 { font-size: 1rem; margin: 0 0 8px; }
.cw-ranking { list-style: none; margin: 0 0 16px; padding: 0; }
.cw-rank { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--cw-line); }
.cw-rank:first-child { background: #FFFBEA; border-radius: 10px; }
.cw-rank-place { flex: none; width: 2.6em; font-weight: 800; color: var(--cw-mute); font-variant-numeric: tabular-nums; }
.cw-rank:first-child .cw-rank-place { color: #B98900; }
.cw-rank-body { display: flex; flex-direction: column; min-width: 0; }
.cw-rank-body strong { color: var(--cw-ink); overflow-wrap: anywhere; }
.cw-rank-detail { font-size: .85rem; color: var(--cw-mute); font-variant-numeric: tabular-nums; }
.cw-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cw-status { min-height: 1.3em; font-size: .9rem; color: var(--cw-text); margin: 6px 0; }
body.test-page .cw-share-url { width: 100%; height: 40px; padding: 6px 10px; border-radius: 10px; font-size: 14px; margin-bottom: 8px; }
.cw-result-links { margin: 8px 0 0; font-size: .92rem; color: var(--cw-mute); }
.cw-result-links a { color: var(--cw-accent-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---- article ---- */
.cw-article { margin-top: 28px; }
.cw-article h2 { font-size: 1.45rem; font-weight: 800; margin: 2rem 0 .75rem; }
.cw-article h3 { font-size: 1.08rem; font-weight: 800; margin: 1.25rem 0 .4rem; }
.cw-article p, .cw-article li { color: var(--cw-text); line-height: 1.68; }
.cw-article p { margin: 0 0 .85rem; }
.cw-article ul, .cw-article ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.cw-article ul { list-style: disc; }
.cw-article ol { list-style: decimal; }
.cw-article li { margin-bottom: .4rem; }
.cw-article a { color: var(--cw-accent-dark); text-decoration: underline; overflow-wrap: anywhere; }
.cw-table-wrap { overflow-x: auto; margin: .5rem 0 1rem; }
.cw-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.cw-table th, .cw-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--cw-line); vertical-align: top; font-variant-numeric: tabular-nums; }
.cw-faq dt { font-weight: 800; color: var(--cw-ink); margin-top: 1rem; }
.cw-faq dd { margin: .25rem 0 0; color: var(--cw-text); line-height: 1.62; }
.cw-more { font-size: .92rem; color: var(--cw-mute); margin-top: 1.5rem; }

/* ---- footer ---- */
.color-war-page footer .site-legal a { color: inherit; }

@media (max-width: 420px) {
  .cw-card { padding: 16px; }
  .cw-stage { padding: 10px 8px 8px; border-radius: 16px; margin-left: -4px; margin-right: -4px; }
  .cw-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; font-size: .84rem; }
  .cw-names { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .cw-switch input, .cw-switch input::after { transition: none; }
}
