/* Illustrated mode
 *
 * One responsive DOM and one chess implementation, with an adult editorial
 * skin and the existing kids preference providing the playful skin. The
 * canonical board workspace is deliberately not restyled below: only its
 * surrounding presentation changes.
 */

.illustrated-welcome,
.illustrated-home-identity,
.illustrated-header-audience,
.illustrated-new-journey {
  display: none;
}

#mode-screen[data-home-experience="illustrated"],
body.illustrated-home-mode,
body.illustrated-feature-mode {
  --ill-ink: #15372c;
  --ill-ink-strong: #0b271f;
  --ill-muted: #637169;
  --ill-paper: #fffaf0;
  --ill-paper-strong: #fffdf8;
  --ill-paper-soft: #f5ecd9;
  --ill-line: #dbc9a8;
  --ill-green: #1f5a42;
  --ill-green-soft: #dce9dd;
  --ill-action-bg: #1f5a42;
  --ill-focus-ring: #0b271f;
  --ill-rust: #b94d2a;
  --ill-gold: #d59018;
  --ill-blue: #2764d7;
  --ill-shadow: 0 18px 45px rgba(49, 39, 24, 0.12);
  --ill-shadow-soft: 0 8px 24px rgba(49, 39, 24, 0.09);
  --ill-radius: 18px;
  --ill-font-display: Georgia, "Times New Roman", serif;
  --ill-font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-kids-theme] #mode-screen[data-home-experience="illustrated"],
:root[data-kids-theme] body.illustrated-home-mode,
:root[data-kids-theme] body.illustrated-feature-mode {
  --ill-ink: #17213a;
  --ill-ink-strong: #111827;
  --ill-muted: #64708b;
  --ill-paper: #f8fbff;
  --ill-paper-strong: #ffffff;
  --ill-paper-soft: #eaf3ff;
  --ill-line: #c9d8ef;
  --ill-green: var(--kids-accent, #2764d7);
  --ill-green-soft: var(--kids-accent-soft, #dbeafe);
  --ill-action-bg: #245a94;
  --ill-focus-ring: #102c4f;
  --ill-rust: #ef4444;
  --ill-gold: #f5b82e;
  --ill-blue: var(--kids-accent, #2764d7);
  --ill-shadow: 0 18px 42px color-mix(in srgb, var(--kids-accent, #2764d7) 16%, transparent);
  --ill-shadow-soft: 0 8px 20px color-mix(in srgb, var(--kids-accent, #2764d7) 12%, transparent);
  --ill-radius: 24px;
  --ill-font-display: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}

:root[data-kids-theme="pink"] #mode-screen[data-home-experience="illustrated"],
:root[data-kids-theme="pink"] body.illustrated-home-mode,
:root[data-kids-theme="pink"] body.illustrated-feature-mode {
  --ill-action-bg: #a02f68;
}

/* Home */

#mode-screen[data-home-experience="illustrated"] {
  display: grid;
  min-height: 100vh;
  place-items: start center;
  overflow: visible;
  background:
    radial-gradient(circle at 8% 3%, rgba(213, 144, 24, 0.13), transparent 25rem),
    radial-gradient(circle at 93% 12%, rgba(31, 90, 66, 0.1), transparent 28rem),
    #f3f1ec;
  color: var(--ill-ink);
  padding: 18px;
  font-family: var(--ill-font-ui);
}


#mode-screen[data-home-experience="illustrated"] .home-dashboard {
  display: grid;
  width: min(1500px, 100%);
  min-height: calc(100vh - 36px);
  gap: 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--ill-line) 75%, white);
  border-radius: 26px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.92), rgba(255, 249, 238, 0.96)),
    repeating-linear-gradient(0deg, rgba(91, 71, 38, 0.025) 0 1px, transparent 1px 5px);
  box-shadow: 0 28px 80px rgba(48, 38, 24, 0.13);
}

#mode-screen[data-home-experience="illustrated"] .home-hero {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f3b2e, #173f32 62%, #274c3d);
  color: #fff7e7;
}

#mode-screen[data-home-experience="illustrated"] .home-logo-link,
#mode-screen[data-home-experience="illustrated"] .home-logo-link img {
  width: 45px;
  height: 45px;
  border-radius: 12px;
}

#mode-screen[data-home-experience="illustrated"] .home-brand-copy {
  display: none;
}

#mode-screen[data-home-experience="illustrated"] .illustrated-home-identity {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  color: #fff7e7;
}

#mode-screen[data-home-experience="illustrated"] .illustrated-home-identity strong {
  overflow: hidden;
  font: 700 clamp(19px, 2vw, 28px)/1 var(--ill-font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#mode-screen[data-home-experience="illustrated"] .illustrated-home-identity span:last-child {
  color: #ead9b6;
  font-weight: 750;
}

#mode-screen[data-home-experience="illustrated"] .home-experience-switch,
#mode-screen[data-home-experience="illustrated"] .home-settings-button,
#mode-screen[data-home-experience="illustrated"] .header-menu-button {
  min-height: 42px;
  border-color: rgba(255, 247, 231, 0.24);
  background: rgba(4, 25, 19, 0.34);
  color: #fff7e7;
}

#mode-screen[data-home-experience="illustrated"] .home-experience-switch {
  padding: 3px;
}

#mode-screen[data-home-experience="illustrated"] .home-experience-switch button {
  min-height: 34px;
  color: #fff7e7;
  padding-inline: 10px;
}

#mode-screen[data-home-experience="illustrated"] .home-experience-switch button:is(:hover, :focus-visible, .active) {
  background: #fff7e7;
  color: #15372c;
}

#mode-screen[data-home-experience="illustrated"] .illustrated-welcome {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--ill-line);
  border-radius: var(--ill-radius);
  background:
    radial-gradient(circle at 86% 12%, rgba(213, 144, 24, 0.12), transparent 17rem),
    linear-gradient(110deg, #f1dfbe 0 31%, var(--ill-paper-strong) 31% 100%);
  box-shadow: var(--ill-shadow-soft);
}

.illustrated-welcome-art {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background:
    radial-gradient(circle at 40% 46%, rgba(255, 248, 222, 0.68), transparent 34%),
    linear-gradient(155deg, #294d3e, #152e26 74%);
}

.illustrated-welcome-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  background:
    linear-gradient(90deg, rgba(222, 191, 130, 0.2), transparent 24%),
    repeating-linear-gradient(90deg, rgba(10, 30, 24, 0.22) 0 20px, transparent 20px 42px);
  clip-path: polygon(0 32%, 16% 18%, 28% 40%, 48% 11%, 63% 36%, 80% 19%, 100% 38%, 100% 100%, 0 100%);
}

.illustrated-welcome-art img {
  position: absolute;
  z-index: 2;
  right: 2%;
  bottom: -8%;
  width: min(94%, 330px);
  height: auto;
  border-radius: 48% 48% 8px 8px;
  filter: saturate(0.76) sepia(0.16) drop-shadow(0 18px 18px rgba(0, 0, 0, 0.32));
}

.illustrated-art-orbit {
  position: absolute;
  z-index: 1;
  display: block;
  border: 1px solid rgba(255, 241, 204, 0.25);
  border-radius: 50%;
}

.illustrated-art-orbit-one {
  top: 25px;
  left: -40px;
  width: 210px;
  height: 210px;
}

.illustrated-art-orbit-two {
  right: -50px;
  bottom: 18px;
  width: 150px;
  height: 150px;
}

.illustrated-welcome-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: clamp(22px, 3.2vw, 46px);
}

.illustrated-welcome-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.illustrated-kicker {
  color: var(--ill-rust) !important;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.illustrated-welcome h1 {
  max-width: 850px;
  color: var(--ill-ink-strong);
  font: 700 clamp(34px, 4.2vw, 61px)/0.98 var(--ill-font-display);
  letter-spacing: -0.025em;
}

.illustrated-welcome-copy > p:not(.illustrated-kicker) {
  color: var(--ill-muted) !important;
  font-size: clamp(16px, 1.45vw, 21px);
}

.illustrated-audience-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  padding: 3px;
  border: 1px solid var(--ill-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.illustrated-audience-switch button {
  min-height: 31px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ill-muted);
  padding: 5px 13px;
  font: 800 12px/1 var(--ill-font-ui);
  cursor: pointer;
}

.illustrated-audience-switch button:is(.active, [aria-pressed="true"]) {
  background: var(--ill-action-bg);
  color: white;
}

#mode-screen:not([data-home-experience="illustrated"]) .illustrated-home-audience,
body:not(.illustrated-feature-mode) .app-header .illustrated-header-audience {
  display: none;
}

.illustrated-first-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.illustrated-first-actions button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  border: 1px solid var(--ill-line);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--ill-ink-strong);
  padding: 10px 13px;
  text-align: left;
  box-shadow: 0 5px 15px rgba(56, 40, 19, 0.06);
  cursor: pointer;
}

.illustrated-first-actions button:is(:hover, :focus-visible) {
  border-color: var(--ill-green);
  background: white;
  transform: translateY(-1px);
}

.illustrated-first-actions button > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.illustrated-first-actions strong {
  font-size: 16px;
}

.illustrated-first-actions small {
  overflow: hidden;
  color: var(--ill-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.illustrated-action-icon {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
  background: var(--ill-green-soft);
  color: var(--ill-green);
}

.illustrated-action-icon svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

#mode-screen[data-home-experience="illustrated"] :is(.home-continue, .home-tip) {
  border-color: var(--ill-line);
  border-radius: var(--ill-radius);
  background: rgba(255, 253, 248, 0.74);
  box-shadow: var(--ill-shadow-soft);
}

#mode-screen[data-home-experience="illustrated"] .home-continue {
  gap: 12px;
  padding: 16px;
}

#mode-screen[data-home-experience="illustrated"] :is(.home-continue h2, .home-section h2) {
  color: var(--ill-ink-strong);
  font-family: var(--ill-font-display);
}

#mode-screen[data-home-experience="illustrated"] .home-continue-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

#mode-screen[data-home-experience="illustrated"] .home-continue-item {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 88px;
  border: 1px solid color-mix(in srgb, var(--ill-line) 72%, white);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.58);
  padding: 10px 12px;
}

#mode-screen[data-home-experience="illustrated"] .home-continue-item:has(.home-progress) {
  grid-template-columns: 44px minmax(0, 1fr) 64px;
}

#mode-screen[data-home-experience="illustrated"] .home-continue-item > .home-icon {
  width: 44px;
  height: 44px;
}

#mode-screen[data-home-experience="illustrated"] .home-continue-item .home-progress {
  position: relative;
  right: auto;
  bottom: auto;
  width: 64px;
  align-self: center;
  justify-self: end;
  margin-top: 18px;
}

#mode-screen[data-home-experience="illustrated"] .home-continue-item .home-progress::before {
  bottom: 13px;
  font-size: 11px;
}

#mode-screen[data-home-experience="illustrated"] .home-continue-item:is(:hover, :focus-visible) {
  border-color: var(--ill-green);
  background: white;
}

#mode-screen[data-home-experience="illustrated"] .home-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#mode-screen[data-home-experience="illustrated"] .home-section {
  position: relative;
  overflow: hidden;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--ill-line);
  border-radius: var(--ill-radius);
  background:
    radial-gradient(circle at 96% 4%, color-mix(in srgb, var(--ill-green-soft) 72%, transparent), transparent 12rem),
    rgba(255, 253, 248, 0.8);
  box-shadow: var(--ill-shadow-soft);
}

#mode-screen[data-home-experience="illustrated"] .home-section:nth-child(2) {
  background:
    radial-gradient(circle at 96% 4%, rgba(213, 144, 24, 0.13), transparent 12rem),
    rgba(255, 253, 248, 0.8);
}

#mode-screen[data-home-experience="illustrated"] .home-section:nth-child(3) {
  background:
    radial-gradient(circle at 96% 4%, rgba(185, 77, 42, 0.11), transparent 12rem),
    rgba(255, 253, 248, 0.8);
}

#mode-screen[data-home-experience="illustrated"] .home-section-heading {
  min-height: 52px;
  padding-bottom: 10px;
  border-color: color-mix(in srgb, var(--ill-line) 72%, transparent);
}

#mode-screen[data-home-experience="illustrated"] .home-section-heading > span {
  border-radius: 50%;
  background: var(--ill-green-soft);
  color: var(--ill-green);
}

#mode-screen[data-home-experience="illustrated"] .home-card-stack.mode-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

#mode-screen[data-home-experience="illustrated"] .home-card-stack.mode-actions button {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-height: 104px;
  gap: 10px;
  border-color: color-mix(in srgb, var(--ill-line) 72%, white);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  padding: 11px;
  box-shadow: none;
}

#mode-screen[data-home-experience="illustrated"] .home-card-stack.mode-actions button:is(:hover, :focus-visible, .selected-mode) {
  border-color: var(--ill-green);
  background: white;
  box-shadow: 0 9px 22px rgba(41, 63, 51, 0.1);
}

#mode-screen[data-home-experience="illustrated"] .home-card-stack .home-icon {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--ill-green-soft);
  color: var(--ill-green);
}

#mode-screen[data-home-experience="illustrated"] .home-card-stack .home-icon svg,
#mode-screen[data-home-experience="illustrated"] .home-card-stack .home-piece-icon img {
  width: 30px;
  height: 30px;
}

#mode-screen[data-home-experience="illustrated"] .home-card-stack strong {
  color: var(--ill-ink-strong);
  font-size: 15px;
}

#mode-screen[data-home-experience="illustrated"] .home-card-stack span span {
  color: var(--ill-muted);
  font-size: 12px;
}

#mode-screen[data-home-experience="illustrated"] .home-card-stack small {
  margin-top: 2px;
  background: var(--ill-green-soft);
  color: var(--ill-green);
}

/* Kids home uses the same geometry with a paper-cut visual language. */

:root[data-kids-theme] #mode-screen[data-home-experience="illustrated"] {
  background:
    radial-gradient(circle at 8% 3%, color-mix(in srgb, var(--kids-accent) 18%, transparent), transparent 25rem),
    radial-gradient(circle at 93% 12%, rgba(245, 184, 46, 0.2), transparent 28rem),
    #eef4fb;
}

:root[data-kids-theme] #mode-screen[data-home-experience="illustrated"] .home-dashboard {
  background:
    radial-gradient(circle at 4% 16%, rgba(255, 255, 255, 0.92), transparent 18rem),
    #f8fbff;
}

:root[data-kids-theme] #mode-screen[data-home-experience="illustrated"] .home-hero {
  background: linear-gradient(115deg, color-mix(in srgb, var(--kids-accent) 92%, #163b8e), var(--kids-accent-2));
}

:root[data-kids-theme] .illustrated-welcome {
  background:
    radial-gradient(circle at 90% 5%, rgba(245, 184, 46, 0.24), transparent 16rem),
    linear-gradient(112deg, color-mix(in srgb, var(--kids-accent-soft) 76%, white) 0 31%, white 31% 100%) !important;
}

:root[data-kids-theme] .illustrated-welcome-art {
  background:
    radial-gradient(circle at 70% 17%, #f5b82e 0 10%, transparent 10.5%),
    radial-gradient(circle at 14% 80%, #4ec78b 0 9%, transparent 9.5%),
    linear-gradient(145deg, var(--kids-accent), color-mix(in srgb, var(--kids-accent) 65%, #42d1c4));
}

:root[data-kids-theme] .illustrated-welcome-art img {
  border-radius: 45% 45% 10% 10%;
  filter: saturate(1.2) drop-shadow(0 18px 16px rgba(12, 42, 94, 0.28));
}

:root[data-kids-theme] #mode-screen[data-home-experience="illustrated"] :is(.home-section, .home-continue, .home-tip) {
  background-color: white;
  box-shadow: var(--ill-shadow-soft);
}

/* Shared feature shell */

body.illustrated-feature-mode {
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 5% 0, rgba(213, 144, 24, 0.12), transparent 27rem),
    radial-gradient(circle at 95% 8%, rgba(31, 90, 66, 0.1), transparent 28rem),
    #f2f0eb;
  color: var(--ill-ink);
  font-family: var(--ill-font-ui);
}

body.illustrated-feature-mode .app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  min-height: 64px;
  gap: 10px;
  border-bottom: 1px solid var(--ill-line);
  background: color-mix(in srgb, var(--ill-paper-strong) 90%, transparent);
  color: var(--ill-ink);
  padding: 8px max(14px, calc((100vw - 1500px) / 2));
  box-shadow: 0 7px 24px rgba(48, 38, 24, 0.07);
  backdrop-filter: blur(16px);
}

body.illustrated-feature-mode .app-home-link img {
  border-radius: 12px;
}

body.illustrated-feature-mode .illustrated-header-audience {
  display: inline-flex;
  margin-left: auto;
}

body.illustrated-feature-mode .app-language-switch {
  margin-left: 0;
}


body.illustrated-feature-mode :is(
  #opponent-screen,
  .opening-practice-screen,
  .placement-tournament-screen,
  .danya-speedruns-screen,
  .career-screen,
  .learning-screen,
  .game-review-screen
) {
  width: min(1500px, calc(100vw - 28px));
  max-width: 1500px;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 24px 14px 40px;
  background: transparent;
  color: var(--ill-ink);
}

body.illustrated-feature-mode :is(
  .opponent-scout,
  .opening-practice-panel,
  .opening-practice-source-panel,
  .opening-practice-side-panel,
  .placement-tournament-setup-form,
  .placement-tournament-summary,
  .placement-tournament-journey,
  .placement-tournament-standings,
  .placement-tournament-rounds,
  .placement-tournament-saved,
  .placement-tournament-certificates,
  .danya-speedruns-video-panel,
  .danya-speedruns-next-panel,
  .danya-speedruns-video-room,
  .danya-speedruns-board-room,
  .career-panel,
  .learning-panel,
  .review-panel
) {
  border-color: var(--ill-line);
  border-radius: var(--ill-radius);
  background: color-mix(in srgb, var(--ill-paper-strong) 92%, transparent);
  color: var(--ill-ink);
  box-shadow: var(--ill-shadow-soft);
}

body.illustrated-feature-mode :is(h1, h2, h3) {
  color: var(--ill-ink-strong);
}

body.illustrated-feature-mode :is(.eyebrow, legend) {
  color: var(--ill-rust);
  font-weight: 900;
  letter-spacing: 0.09em;
}

body.illustrated-feature-mode :is(button, select, input, textarea) {
  font-family: var(--ill-font-ui);
}

body.illustrated-feature-mode :is(button, a):focus-visible {
  outline: 3px solid var(--ill-focus-ring);
  outline-offset: 2px;
}

/* Opening practice */

body.illustrated-feature-mode .opening-practice-header {
  align-items: end;
  padding: 8px 4px 18px;
  border-bottom: 1px solid var(--ill-line);
}

body.illustrated-feature-mode .opening-practice-header h1 {
  font: 700 clamp(34px, 4vw, 54px)/1 var(--ill-font-display);
}

body.illustrated-feature-mode .opening-practice-setup {
  gap: 16px;
}

body.illustrated-feature-mode .opening-practice-panel,
body.illustrated-feature-mode .opening-practice-source-panel,
body.illustrated-feature-mode .opening-practice-side-panel {
  padding: 18px;
}

body.illustrated-feature-mode :is(.opening-practice-tabs, .opening-practice-mode-options) button,
body.illustrated-feature-mode :is(.opening-practice-settings, .opening-practice-custom-fields) select,
body.illustrated-feature-mode :is(.opening-practice-settings, .opening-practice-custom-fields) input {
  border-color: var(--ill-line);
  border-radius: 12px;
  background: white;
  color: var(--ill-ink-strong);
}

body.illustrated-feature-mode :is(.opening-practice-tabs, .opening-practice-mode-options) button:is(.active, [aria-selected="true"], [aria-pressed="true"]) {
  border-color: var(--ill-green);
  background: var(--ill-action-bg);
  color: white;
}

body.illustrated-feature-mode .opening-practice-line-card,
body.illustrated-feature-mode .opening-practice-queue-card,
body.illustrated-feature-mode .opening-practice-opening-row {
  border-color: color-mix(in srgb, var(--ill-line) 78%, white);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.8);
}

body.illustrated-feature-mode .opening-practice-line-card:is(:hover, :focus-visible),
body.illustrated-feature-mode .opening-practice-queue-card:is(:hover, :focus-visible),
body.illustrated-feature-mode .opening-practice-opening-row:is(:hover, :focus-visible) {
  border-color: var(--ill-green);
  background: white;
}

body.illustrated-feature-mode #opening-practice-start,
body.illustrated-feature-mode .opening-practice-primary-action {
  border-color: var(--ill-green);
  border-radius: 12px;
  background: var(--ill-action-bg);
  color: white;
}

/* Tournaments */

body.illustrated-feature-mode .placement-tournament-header {
  align-items: end;
  gap: 18px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--ill-line);
}

body.illustrated-feature-mode .placement-tournament-header h1 {
  font: 700 clamp(34px, 4vw, 54px)/1 var(--ill-font-display);
}

body.illustrated-feature-mode .placement-tournament-header > div:first-child {
  position: relative;
  padding-left: 78px;
}

body.illustrated-feature-mode .placement-tournament-header > div:first-child::before {
  content: "♜";
  position: absolute;
  top: 0;
  left: 4px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: var(--ill-green);
  color: white;
  font-size: 32px;
  box-shadow: var(--ill-shadow-soft);
}

body.illustrated-feature-mode .placement-tournament-setup-form {
  padding: clamp(18px, 2.3vw, 30px);
}

body.illustrated-feature-mode .placement-setup-stepper li span {
  border-color: var(--ill-green);
  background: var(--ill-green-soft);
  color: var(--ill-green);
}

body.illustrated-feature-mode .placement-tournament-setup-form fieldset {
  border-color: color-mix(in srgb, var(--ill-line) 78%, white);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
}

body.illustrated-feature-mode :is(.placement-rating-options, .placement-time-options) label,
body.illustrated-feature-mode .placement-time-control-chips label,
body.illustrated-feature-mode .placement-fide-option {
  border-color: var(--ill-line);
  border-radius: 13px;
  background: white;
}

body.illustrated-feature-mode :is(.placement-rating-options, .placement-time-options) label:has(input:checked),
body.illustrated-feature-mode .placement-time-control-chips label:has(input:checked) {
  border-color: var(--ill-green);
  background: var(--ill-green-soft);
  box-shadow: inset 0 0 0 1px var(--ill-green);
}

body.illustrated-feature-mode #placement-tournament-create,
body.illustrated-feature-mode #placement-journey-start-round,
body.illustrated-feature-mode .placement-tournament-start-round {
  border-color: var(--ill-green);
  border-radius: 12px;
  background: var(--ill-action-bg);
  color: white;
}

body.illustrated-feature-mode .placement-tournament-journey {
  overflow: hidden;
  border-image: none;
  outline: 0;
  background:
    radial-gradient(circle at 91% 8%, rgba(213, 144, 24, 0.15), transparent 19rem),
    var(--ill-paper-strong);
  padding: 24px;
}

body.illustrated-feature-mode .placement-journey-event {
  border-color: var(--ill-line);
}

body.illustrated-feature-mode .placement-journey-event h2 {
  font-family: var(--ill-font-display);
}

body.illustrated-feature-mode .placement-journey-current {
  border-image: none;
  outline: 0;
  border-color: var(--ill-line);
  border-radius: 16px;
  background: var(--ill-paper-soft);
}

/* Rival selection */

body.illustrated-feature-mode #opponent-screen {
  place-items: stretch;
}

body.illustrated-feature-mode .opponent-scout {
  width: min(1420px, 100%);
  gap: 16px;
  padding: clamp(18px, 2.4vw, 32px);
}

body.illustrated-feature-mode .opponent-roster-header {
  position: relative;
  min-height: 76px;
  padding: 4px 4px 16px 80px;
  border-bottom: 1px solid var(--ill-line);
}

body.illustrated-feature-mode .opponent-roster-header::before {
  content: "♞";
  position: absolute;
  top: 2px;
  left: 3px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  background: var(--ill-rust);
  color: white;
  font-size: 32px;
}

body.illustrated-feature-mode .opponent-roster-header h1 {
  font: 700 clamp(36px, 4vw, 54px)/1 var(--ill-font-display);
}

body.illustrated-feature-mode .opponent-roster-nav button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ill-green);
  padding: 5px 11px;
  font-weight: 800;
}

body.illustrated-feature-mode .opponent-roster-nav button:is(:hover, :focus-visible) {
  border-color: var(--ill-line);
  background: var(--ill-paper-soft);
}

body.illustrated-feature-mode :is(.opponent-time-setup, .opponent-practice-row) {
  border-color: var(--ill-line);
  border-radius: 15px;
  background: var(--ill-paper-soft);
}

body.illustrated-feature-mode .opponent-practice-row {
  padding: 9px 12px;
}

body.illustrated-feature-mode .opponent-time-grid :is(select, input),
body.illustrated-feature-mode .opponent-roster-filters select {
  border-color: var(--ill-line);
  border-radius: 10px;
  background: white;
  color: var(--ill-ink-strong);
}

body.illustrated-feature-mode .opponent-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body.illustrated-feature-mode .opponent-card {
  overflow: hidden;
  border-color: var(--ill-line);
  border-radius: 17px;
  background: white;
  box-shadow: var(--ill-shadow-soft);
}

body.illustrated-feature-mode .opponent-card-header {
  display: grid;
  grid-template-areas:
    "portrait identity rating"
    "portrait record record";
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: start;
  min-height: 112px;
  gap: 13px;
  background:
    radial-gradient(circle at 100% 0, var(--ill-green-soft), transparent 11rem),
    var(--ill-paper-strong);
}

body.illustrated-feature-mode .opponent-card-header > div {
  grid-area: identity;
  min-width: 0;
}

body.illustrated-feature-mode .opponent-card-header .opponent-card-portrait {
  grid-area: portrait;
}

body.illustrated-feature-mode .opponent-card-header .opponent-rating {
  grid-area: rating;
}

body.illustrated-feature-mode .opponent-card-header .opponent-record {
  grid-area: record;
  justify-self: start;
}

body.illustrated-feature-mode .opponent-card-header :is(.eyebrow, h2) {
  overflow: hidden;
  text-overflow: ellipsis;
}

body.illustrated-feature-mode .opponent-card-portrait {
  width: 84px;
  height: 96px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--ill-green-soft), white);
  object-fit: contain;
}

body.illustrated-feature-mode .opponent-card-actions {
  gap: 8px;
  padding: 10px;
}

body.illustrated-feature-mode .opponent-card-actions button {
  min-height: 43px;
  border-color: var(--ill-green);
  border-radius: 11px;
  background: var(--ill-action-bg);
  color: white;
}

body.illustrated-feature-mode .opponent-card-actions button:last-child {
  background: white;
  color: var(--ill-green);
}

body.illustrated-feature-mode .opponent-pagination {
  border-top: 1px solid var(--ill-line);
  padding-top: 14px;
}

body.illustrated-feature-mode .opponent-pagination button {
  border-color: var(--ill-line);
  border-radius: 10px;
  background: var(--ill-paper-soft);
  color: var(--ill-green);
}

body.illustrated-feature-mode .opponent-pagination button:is(:hover, :focus-visible):not(:disabled) {
  border-color: var(--ill-green);
  background: var(--ill-action-bg);
  color: white;
}

body.illustrated-feature-mode .opponent-pagination-hint {
  color: var(--ill-muted);
}

/* Live match: same board workspace, responsive illustrated furniture. */

body.illustrated-feature-mode.board-first-mode .shell.live-match-frame {
  --opponent-board-size: min(
    720px,
    calc(100vh - 250px),
    calc(
      100vw - var(--opponent-side-width) - var(--opponent-moves-width) - var(--opponent-eval-width) -
        var(--opponent-top-width) - var(--opponent-shell-gap) - var(--opponent-play-gaps) - 88px
    )
  );
  position: relative;
  display: grid;
  width: min(1480px, calc(100vw - 24px));
  height: calc(100vh - 82px);
  min-height: 0;
  margin: 10px auto 0;
  overflow: hidden;
  border: 1px solid var(--ill-line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 6%, rgba(213, 144, 24, 0.13), transparent 18rem),
    var(--ill-paper);
  padding: 12px;
  box-shadow: var(--ill-shadow);
  transform: none;
}

body.illustrated-feature-mode .shell.live-match-frame .side {
  gap: 10px;
  overflow: auto;
  border: 1px solid var(--ill-line);
  border-image: none;
  border-radius: 16px;
  outline: 0;
  background: var(--ill-paper-strong);
  color: var(--ill-ink);
  box-shadow: none;
}

body.illustrated-feature-mode .shell.live-match-frame .player-strip {
  border: 1px solid var(--ill-line);
  border-image: none;
  border-radius: 11px;
  background: var(--ill-paper-strong);
  color: var(--ill-ink);
  box-shadow: var(--ill-shadow-soft);
}

body.illustrated-feature-mode .shell.live-match-frame .player-name {
  color: var(--ill-ink-strong);
  font-family: var(--ill-font-ui);
  text-shadow: none;
}

body.illustrated-feature-mode .shell.live-match-frame .live-player-portrait {
  border-color: var(--ill-line);
  border-radius: 8px;
  background: var(--ill-green-soft);
  box-shadow: none;
}

body.illustrated-feature-mode .shell.live-match-frame .player-clock {
  border: 1px solid var(--ill-line);
  border-radius: 9px;
  background: var(--ill-paper-soft);
  color: var(--ill-ink-strong);
  box-shadow: none;
}

body.illustrated-feature-mode .shell.live-match-frame .player-clock.active {
  border-color: var(--ill-green);
  background: var(--ill-action-bg);
  color: white;
}

body.illustrated-feature-mode .shell.live-match-frame .board-wrap {
  border: 8px solid var(--ill-ink-strong);
  border-image: none;
  border-radius: 8px;
  background: var(--ill-ink-strong);
  box-shadow: 0 16px 36px rgba(31, 39, 31, 0.2);
}

body.illustrated-feature-mode .shell.live-match-frame :is(
  .opponent-game-panel,
  .controls,
  .moves-panel,
  .automatic-review-status,
  .opponent-result-panel,
  .play-tips-panel,
  .opponent-practice-panel,
  .opponent-debug-panel,
  .top-lines
) {
  border: 1px solid var(--ill-line);
  border-radius: 12px;
  background: var(--ill-paper-strong);
  color: var(--ill-ink);
  box-shadow: none;
}

body.illustrated-feature-mode .shell.live-match-frame :is(
  .opponent-game-panel h2,
  .opponent-game-panel h3,
  .controls h2,
  .moves-panel h2,
  .opponent-debug-panel summary,
  .opponent-game-details dd,
  .top-lines h2
) {
  color: var(--ill-ink-strong);
}

body.illustrated-feature-mode .shell.live-match-frame :is(
  .opponent-game-details dt,
  .opponent-game-summary,
  .maia3-play-summary,
  .top-moves strong
) {
  color: var(--ill-muted);
}

body.illustrated-feature-mode .shell.live-match-frame .side button {
  border: 1px solid var(--ill-line);
  border-radius: 10px;
  background: var(--ill-paper-soft);
  color: var(--ill-ink-strong);
  box-shadow: none;
}

body.illustrated-feature-mode .shell.live-match-frame .side button:is(:hover, :focus-visible, .active, [aria-pressed="true"]) {
  border-color: var(--ill-green);
  background: var(--ill-action-bg);
  color: white;
}

body.illustrated-feature-mode .shell.live-match-frame #status {
  border-color: var(--ill-line);
  border-radius: 10px;
  background: var(--ill-paper-soft);
  color: var(--ill-ink-strong);
}

body.illustrated-feature-mode .live-match-event {
  border-color: var(--ill-line);
}

body.illustrated-feature-mode .live-match-event:not(:has(> img:not([hidden]))) {
  grid-template-columns: minmax(0, 1fr);
}

body.illustrated-feature-mode .live-match-event :is(h1, .eyebrow),
body.illustrated-feature-mode .live-match-meta {
  color: var(--ill-ink-strong);
  text-shadow: none;
}

body.illustrated-feature-mode .live-match-event .eyebrow {
  color: var(--ill-rust);
}

/* Danya library and watch room */

body.illustrated-feature-mode .danya-speedruns-shell {
  width: min(1470px, 100%);
  gap: 16px;
}

body.illustrated-feature-mode .danya-speedruns-series-tabs {
  padding: 7px;
  border: 1px solid var(--ill-line);
  border-radius: 14px;
  background: var(--ill-paper-strong);
  box-shadow: var(--ill-shadow-soft);
}

body.illustrated-feature-mode .danya-speedruns-series-tabs button {
  border-radius: 10px;
}

body.illustrated-feature-mode .danya-speedruns-series-tabs button:is(.active, [aria-selected="true"]) {
  background: var(--ill-action-bg);
  color: white;
}

body.illustrated-feature-mode .danya-speedruns-library-grid,
body.illustrated-feature-mode .danya-speedruns-watch {
  gap: 16px;
}

body.illustrated-feature-mode :is(.danya-speedruns-video-panel, .danya-speedruns-next-panel, .danya-speedruns-video-room, .danya-speedruns-board-room) {
  padding: 18px;
}

body.illustrated-feature-mode :is(.danya-speedruns-video-room, .danya-speedruns-board-room) {
  max-width: 100%;
  overflow-x: hidden;
}

body.illustrated-feature-mode .danya-speedruns-board-room > .learning-node-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

body.illustrated-feature-mode .danya-speedruns-board-room > .learning-node-heading h2 {
  white-space: normal;
}

body.illustrated-feature-mode .danya-speedruns-board-room .learning-node-actions {
  flex-wrap: wrap;
}

body.illustrated-feature-mode .danya-speedruns-board-area {
  --review-board-size: min(calc(100% - 48px), calc(100vh - 410px), 640px);
  max-width: 100%;
}

body.illustrated-feature-mode .danya-speedruns-board-area.eval-hidden {
  --review-board-size: min(100%, calc(100vh - 410px), 640px);
}

body.illustrated-feature-mode .danya-speedruns-screen.board-focus .danya-speedruns-board-area {
  --review-board-size: min(calc(100% - 48px), calc(100vh - 320px), 760px);
}

body.illustrated-feature-mode .danya-speedruns-screen.board-focus .danya-speedruns-board-area.eval-hidden {
  --review-board-size: min(100%, calc(100vh - 320px), 760px);
}

body.illustrated-feature-mode .danya-speedruns-screen .danya-speedruns-board-controls {
  width: 100%;
  grid-template-columns: repeat(3, minmax(82px, 1fr)) minmax(142px, 1.4fr);
  justify-content: stretch;
}

body.illustrated-feature-mode .danya-speedruns-screen .danya-speedruns-board-controls button.learning-icon-control:not(.square) {
  width: auto;
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
}

body.illustrated-feature-mode .danya-speedruns-video-card,
body.illustrated-feature-mode .danya-speedruns-next-card {
  overflow: hidden;
  border-color: var(--ill-line);
  border-radius: 14px;
  background: white;
}

body.illustrated-feature-mode .danya-speedruns-progress-pill {
  border-color: var(--ill-green);
  border-radius: 999px;
  background: var(--ill-green-soft);
  color: var(--ill-green);
}

body.illustrated-feature-mode .danya-speedruns-player {
  overflow: hidden;
  border: 7px solid var(--ill-ink-strong);
  border-radius: 15px;
  background: #090f0d;
  box-shadow: var(--ill-shadow);
}

body.illustrated-feature-mode .danya-speedruns-board-wrap {
  border-color: var(--ill-ink-strong);
  border-radius: 8px;
  box-shadow: var(--ill-shadow);
}

/* Kids feature details */

:root[data-kids-theme] body.illustrated-feature-mode {
  background:
    radial-gradient(circle at 6% 0, color-mix(in srgb, var(--kids-accent) 16%, transparent), transparent 25rem),
    radial-gradient(circle at 96% 8%, rgba(245, 184, 46, 0.2), transparent 28rem),
    #eef4fb;
}

:root[data-kids-theme] body.illustrated-feature-mode .app-header {
  background: rgba(255, 255, 255, 0.91);
}

:root[data-kids-theme] body.illustrated-feature-mode :is(
  .opponent-scout,
  .opening-practice-panel,
  .opening-practice-source-panel,
  .opening-practice-side-panel,
  .placement-tournament-setup-form,
  .placement-tournament-journey,
  .danya-speedruns-video-panel,
  .danya-speedruns-next-panel,
  .danya-speedruns-video-room,
  .danya-speedruns-board-room,
  .shell.live-match-frame,
  .shell.live-match-frame .side
) {
  background-color: white;
  box-shadow: var(--ill-shadow-soft);
}

:root[data-kids-theme] body.illustrated-feature-mode .opponent-roster-header::before,
:root[data-kids-theme] body.illustrated-feature-mode .placement-tournament-header > div:first-child::before {
  background: var(--kids-accent);
}

:root[data-kids-theme] body.illustrated-feature-mode .opponent-card-portrait {
  background:
    radial-gradient(circle at 75% 18%, #f5b82e 0 9%, transparent 9.5%),
    linear-gradient(145deg, var(--kids-accent-soft), white);
}

@media (max-width: 1180px) {
  #mode-screen[data-home-experience="illustrated"] .home-hero {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  #mode-screen[data-home-experience="illustrated"] .home-experience-switch {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: center;
  }

  #mode-screen[data-home-experience="illustrated"] .home-continue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #mode-screen[data-home-experience="illustrated"] .home-section-grid {
    grid-template-columns: 1fr;
  }

  body.illustrated-feature-mode .opponent-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  #mode-screen[data-home-experience="illustrated"] {
    padding: 8px;
  }

  #mode-screen[data-home-experience="illustrated"] .home-dashboard {
    min-height: calc(100vh - 16px);
    padding: 8px;
    border-radius: 18px;
  }

  #mode-screen[data-home-experience="illustrated"] .home-hero {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    border-radius: 13px;
  }

  #mode-screen[data-home-experience="illustrated"] .home-experience-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  #mode-screen[data-home-experience="illustrated"] .home-experience-switch button {
    min-width: 0;
    padding-inline: 5px;
    font-size: 12px;
    white-space: nowrap;
  }

  #mode-screen[data-home-experience="illustrated"] .illustrated-home-identity span[aria-hidden="true"],
  #mode-screen[data-home-experience="illustrated"] .illustrated-home-identity span:last-child,
  #mode-screen[data-home-experience="illustrated"] .home-settings-button {
    display: none;
  }

  #mode-screen[data-home-experience="illustrated"] .illustrated-welcome {
    grid-template-columns: 1fr;
  }

  .illustrated-welcome-art {
    min-height: 215px;
  }

  .illustrated-welcome-art img {
    right: 50%;
    width: 230px;
    transform: translateX(50%);
  }

  .illustrated-welcome-copy {
    padding: 20px;
  }

  .illustrated-welcome-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .illustrated-first-actions,
  #mode-screen[data-home-experience="illustrated"] .home-card-stack.mode-actions,
  #mode-screen[data-home-experience="illustrated"] .home-continue-grid,
  body.illustrated-feature-mode .opponent-list {
    grid-template-columns: 1fr;
  }

  body.illustrated-feature-mode .app-header {
    flex-wrap: wrap;
    padding-inline: 7px;
  }

  body.illustrated-feature-mode .illustrated-header-audience {
    display: inline-flex;
    order: 5;
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  body.illustrated-feature-mode :is(
    #opponent-screen,
    .opening-practice-screen,
    .placement-tournament-screen,
    .danya-speedruns-screen
  ) {
    width: min(100%, calc(100vw - 12px));
    padding: 14px 4px 28px;
  }

  body.illustrated-feature-mode .opponent-roster-header,
  body.illustrated-feature-mode .placement-tournament-header > div:first-child {
    padding-left: 0;
  }

  body.illustrated-feature-mode .opponent-roster-header::before,
  body.illustrated-feature-mode .placement-tournament-header > div:first-child::before {
    display: none;
  }

  body.illustrated-feature-mode .opponent-card-header {
    grid-template-columns: 76px minmax(0, 1fr) auto;
  }

  body.illustrated-feature-mode .opponent-card-portrait {
    width: 70px;
    height: 82px;
  }

  body.illustrated-feature-mode.board-first-mode .shell.live-match-frame {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: calc(100vh - 72px);
    overflow: visible;
    padding: 7px;
  }

  body.illustrated-feature-mode .danya-speedruns-screen .danya-speedruns-board-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.illustrated-feature-mode .danya-speedruns-screen #danya-speedruns-analyze-board {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mode-screen[data-home-experience="illustrated"] *,
  body.illustrated-feature-mode * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
