/* The Missing Piece: a little workbench, with the project always in view. */
:root {
  --bg: #081220;
  --deep: #050d18;
  --panel: #101e30;
  --ink: #f2f6ff;
  --muted: #a7b8ce;
  --gold: #ffd28c;
  --gold-deep: #eeac55;
  --teal: #7de7f5;
  --line: #8eb3df26;
  --serif: 'DM Sans', system-ui, sans-serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --blueprint: #6dc6ed;
}

body { background: var(--bg); }
h1, h2, h3 { font-weight: 600; }
.sidebar { background: linear-gradient(180deg, #081222, #050d18); }
.wordmark { width: 176px; max-width: 100%; font-size: 25px; line-height: 1.12; font-weight: 700; letter-spacing: -.9px; }
.wordmark-title { display: block; }
.wordmark-spark { top: 5px; right: 2px; margin-left: 0; color: var(--teal); }
.sidebar-tagline { font-size: 11px; line-height: 1.8; }
.nav-item.active { background: #78d9fa0e; color: var(--teal); }
.nav-item.active i { background: var(--teal); }
.progress-track { height: 4px; background: #93acd71a; }
.progress-track i { background: linear-gradient(90deg, #71cef1, #b8f2fd); }
.small-progress span:first-child, .sidebar-bottom > p { color: var(--muted); }
.mobile-nav { background: #071222f2; }
.mobile-header .icon-button { background: #11223990; }
.btn { border-radius: 12px; }
.btn.primary { background: linear-gradient(125deg, #ffe1ab, #ffc875); color: #252014; box-shadow: 0 8px 30px #f9bc5715; }
.btn.primary:hover { background: #ffe3b6; }
.btn.secondary { background: #182b43; border-color: #9db8d828; }
.btn.outline { background: #11223970; border-color: #bfd7f34f; font-weight: 500; font-size: 14px; }
.eyebrow { color: var(--teal); font-size: 9px; letter-spacing: 1.9px; }
.eyebrow > span { background: var(--teal); }
.text-button:hover { color: var(--teal); }
.icon-button:hover { background: #79dafa14; color: var(--teal); }

/* The opening model is part of the composition, rather than a wallpaper. */
.construction-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(290px, 1.1fr);
  grid-template-areas: 'copy model' 'actions model' 'note note';
  align-content: center;
  align-items: center;
  gap: 28px 18px;
  min-height: min(850px, calc(100svh - 78px));
  padding: 62px clamp(28px, 5.5vw, 85px) 32px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 85% 32%, #163656aa, transparent 56%), linear-gradient(140deg, #0a172a, #07101e 70%);
}
.construction-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle at 12% 17%, #d8eaff8c 0 1px, transparent 1.5px), radial-gradient(circle at 66% 28%, #90d3f07a 0 1px, transparent 1.5px), radial-gradient(circle at 35% 78%, #a5badf61 0 1px, transparent 1.5px);
  background-size: 173px 197px, 233px 229px, 307px 283px;
  opacity: .38;
  pointer-events: none;
}
.hero-art, .hero-shade { background: none; }
.construction-hero .hero-art, .construction-hero .hero-shade { display: none; }
.construction-hero .hero-copy { grid-area: copy; min-width: 0; max-width: 570px; margin: 0; text-align: left; }
.construction-hero .hero-copy h1 { color: var(--ink); font-size: clamp(48px, 5.4vw, 72px); font-weight: 700; line-height: 1.06; letter-spacing: -.055em; margin: 21px 0 20px; text-shadow: none; }
.construction-hero .hero-copy h1 em { color: var(--teal); font-style: normal; }
.construction-hero .hero-copy h1 sup { color: var(--teal); font-size: 21px; margin-top: 8px; }
.construction-hero .hero-tagline { color: #f1f6ff; font-size: clamp(21px, 2.2vw, 30px); line-height: 1.35; font-weight: 500; letter-spacing: -.65px; max-width: 425px; }
.construction-hero .hero-description { display: block; max-width: 360px; color: var(--muted); font-size: 13px; line-height: 1.85; margin-top: 19px; }
.construction-hero .hero-model { grid-area: model; position: relative; min-width: 0; margin: 0 -50px 0 -35px; pointer-events: none; }
.hero-model > svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero-model-label { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: -15px; }
.hero-model-label::before { content: ''; width: 22px; height: 1px; background: var(--teal); }
.hero-model-caption { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font-size: 11px; line-height: 1.7; color: #c4d4e7; margin-top: 9px; }
.hero-model-caption strong, .hero-model-caption span { display: block; }
.hero-model-caption strong { font-size: 14px; font-weight: 500; color: var(--ink); }
.hero-model-caption > span { color: var(--muted); font-size: 10px; }
.construction-hero .welcome-actions { grid-area: actions; align-self: start; width: 325px; max-width: 100%; margin: 0; padding: 0; }
.construction-hero .welcome-actions .primary { min-height: 57px; font-size: 17px; font-weight: 650; border-radius: 13px; }
.construction-hero .welcome-actions .outline { min-height: 48px; font-size: 12px; border-radius: 12px; }
.construction-hero .hero-kicker { color: #bed0e8; font-size: 8px; letter-spacing: 1.9px; text-align: left; margin-bottom: 13px; }
.construction-hero .purchase-promise { color: var(--muted); font-size: 10px; }
.construction-hero .hero-village-link { color: var(--teal); font-size: 11px; }
.construction-hero .home-learn-link { color: #c9d8eb; margin-top: 8px; font-size: 11px; }
.construction-hero .hero-note { display: flex; grid-area: note; position: static; justify-self: start; padding-top: 25px; margin-top: 10px; border-color: var(--line); width: 100%; gap: 12px; }
.construction-hero .hero-note strong { font-size: 12px; font-weight: 500; }
.construction-hero .hero-note p { font-size: 10px; margin-top: 4px; }
.construction-hero .mini-orbit { color: var(--teal); font-size: 27px; }
.home-bottom { background: #091423; }
.home-bottom .icon { color: var(--teal); }
.home-journey { background: #0a1627; }
.home-journey-scene { background: #08111f; border-color: #9bbfde29; box-shadow: 0 24px 50px #03091066; }
.home-journey-copy h2 { font-size: 29px; font-weight: 600; line-height: 1.22; letter-spacing: -.9px; }
.home-journey-copy > span:not(.eyebrow) { color: var(--teal); }

/* World projects read as a collection of models on a workbench. */
.villages-screen, .daily-screen, .quick-screen { background: radial-gradient(ellipse at 100% 0, #19395a2e, transparent 55%); }
.page-heading h1 { font-weight: 650; line-height: 1.15; letter-spacing: -1.6px; }
.journey-summary .icon { color: var(--teal); }
.village-tab { border-radius: 11px; background: #0c1828; min-height: 43px; }
.village-tab.selected { background: #75d6fa10; color: var(--teal); border-color: #75d6fa70; }
.living-village { background: linear-gradient(145deg, #142339, #0c1829); border-color: #8fb7d934; border-radius: 22px; box-shadow: 0 18px 45px #0309113b; }
.village-heading h2 { font-weight: 650; font-size: 36px; letter-spacing: -1.35px; }
.village-heading p { color: #b3c3d8; }
.village-state-badge { color: var(--teal); background: #7adcf906; border-color: #7adcf92f; }
.village-panorama { background: #091422; border: 1px solid #94b7d512; }
.village-lit-count { color: var(--teal); }
.village-status > .btn { min-width: 172px; }
.lane-section-heading h2 { font-size: 23px; font-weight: 600; letter-spacing: -.6px; }
.level-card { background: linear-gradient(145deg, #132238, #0e1a2b); border-color: #89acd028; }
.level-card:hover { border-color: #8cdbfa74; }
.village-levels .level-card { min-height: 258px; padding: 22px 13px 19px; overflow: hidden; }
.village-levels .level-card.completed { background: linear-gradient(145deg, #1b3043, #102133); border-color: #7bcbdc69; }
.village-levels .level-card.completed::after { color: var(--teal); }
.level-number { color: #9aafc8; font-size: 9px; }
.village-levels .level-house { display: grid; place-items: center; width: 100%; height: 112px; margin: 9px 0 10px; opacity: 1; }
.level-house > svg { display: block; width: 100%; height: 100%; }
.level-house > .icon { width: 27px; height: 27px; color: #8da8c5; }
.village-levels .building-name { font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: -.1px; }
.village-levels .level-name { font-size: 10px; line-height: 1.5; }
.village-levels .level-description { color: #9eafc8; font-size: 9px; margin-bottom: 14px; }
.level-ready { color: #b4c4d9; }
.level-card.locked .level-house { opacity: 1; }
.unlock-ribbon { background: #122338; border-color: #c5aa6534; }
.unlock-ribbon strong { font-size: 16px; font-weight: 500; }
.keepsake-shelf { background: #0a1525; border-color: #8eb3df26; }
.keepsake-shelf h2 { font-size: 26px; font-weight: 600; letter-spacing: -.6px; }
.keepsake-medal { background: #14253a; color: #8399b8; border-color: #829fc755; border-radius: 16px; }
.keepsake strong { font-size: 12px; font-weight: 500; }
.keepsake.earned .keepsake-medal { background: radial-gradient(circle, #72d6f520, #13253b); color: var(--teal); border-color: #77d5ee8c; box-shadow: 0 0 24px #75daf10a; }
.keepsake.earned strong, .keepsake.earned > span:last-child { color: var(--teal); }
.keepsake-medal i { background: var(--teal); color: #0d2236; }
.keepsake-dialog-scene, .reward-scene, .aside-village { background: #091421; }

/* The playable grid assembles one component; its destination sits beside it. */
.play-screen { background: radial-gradient(ellipse at 45% 28%, #234b712e, transparent 63%), #081220; }
.game-top h1 { font-size: 25px; font-weight: 600; letter-spacing: -.7px; }
.score, .tutorial-score { background: #0c192cbd; }
.score { font-size: 16px; }
.score strong, .tutorial-score strong { font-weight: 600; }
.score.teal.current { border-color: var(--teal); }
.turn-pill { background: var(--gold); }
.turn-pill.pip { background: #133648; color: #a1edfb; }
.board-surround:has(.construction-board) { background: linear-gradient(145deg, #0e2036bb, #081524dd); border: 1px solid #78b8e52c; border-radius: 19px; box-shadow: inset 0 0 45px #030b1799, 0 18px 35px #02081338; padding: 27px; }
.construction-board { position: relative; isolation: isolate; }
.construction-board .assembly-art { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.construction-board .assembly-art > svg { display: block; width: 100%; height: 100%; }
.construction-board .board-cell { z-index: 1; border-radius: 0; pointer-events: none; }
.construction-board .board-cell.claimed { background: #ffd28c05; animation: light-up .5s ease-out; }
.construction-board .board-cell.owner-1 { background: #7de7f505; }
.construction-board .board-cell.claimed::after { content: ''; position: absolute; right: 8%; top: 8%; width: 20%; height: 20%; border-top: 1px solid #ffd28c80; border-right: 1px solid #ffd28c80; border-radius: 0 4px 0 0; }
.construction-board .board-cell.owner-1::after { border-color: #7de7f580; }
.construction-board .cell-owner { top: 12%; right: 12%; z-index: 2; background: #081423b3; border-radius: 50%; padding: 3px; }
.construction-board .cell-owner > .icon { width: 11px; height: 11px; }
.construction-board .dot { width: 12px; height: 12px; background: radial-gradient(circle at 35% 25%, #f8fbff, #b8cfe4); box-shadow: 0 0 0 3px #07122199, 0 0 9px #b4d5f127; }
.construction-board .edge.horizontal:not(.drawn) span { background: repeating-linear-gradient(90deg, #91b3d36b 0, #91b3d36b 5px, transparent 5px, transparent 11px); }
.construction-board .edge.vertical:not(.drawn) span { background: repeating-linear-gradient(0deg, #91b3d36b 0, #91b3d36b 5px, transparent 5px, transparent 11px); }
.construction-board .edge.drawn.owner-0 span { box-shadow: 0 0 0 1px #09111d, 0 0 6px #ffd28c59; }
.construction-board .edge.drawn.owner-1 span { box-shadow: 0 0 0 1px #09111d, 0 0 6px #7de7f53d; }
.construction-board .edge:not(:disabled):hover span, .construction-board .edge:not(:disabled):focus-visible span { background: var(--gold); box-shadow: 0 0 12px #ffdb8e55; }
.game-message { font-size: 17px; font-weight: 500; }
.game-hint { color: #a9bdd6; }
.match-home-note .icon { color: var(--teal); }
.prepared-board-note { background: #78c8f008; border-color: #78c8f027; }
.prepared-board-note strong { color: var(--teal); }
.assembly-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px 15px; max-width: 510px; margin: 16px auto; padding: 0 5px; font-size: 10px; line-height: 1.6; color: var(--muted); }
.assembly-progress strong { color: var(--teal); font-weight: 500; }
.assembly-progress .progress-track { grid-column: 1 / -1; height: 3px; }
.game-scenery, .game-scenery.has-village { background: none; mask-image: none; opacity: .9; }
.game-scenery.has-village { max-height: 220px; border: 1px solid #86b6d71c; }
.game-aside h2 { font-size: 28px; font-weight: 600; letter-spacing: -.8px; }
.result-card { background: linear-gradient(145deg, #152e42, #102033); border-color: #88c8e848; }
.result-card h2 { font-weight: 600; }
.completed-model { height: 220px; margin: -6px -10px 15px; display: grid; place-items: center; border-radius: 13px; background: radial-gradient(ellipse, #2a52774a, transparent 75%); }
.completed-model > svg { display: block; width: 100%; height: 100%; }
.village-reward { border-color: #8eb3df26; }
.village-reward > h3 { font-weight: 600; font-size: 22px; }
.village-celebration { background: radial-gradient(ellipse at top, #78d8fa15, transparent 75%); border-color: #7dd4ec5c; }
.village-celebration h3, .village-celebration strong, .celebration-spark { color: var(--teal); }
.village-celebration h3 { font-size: 23px; }
.village-celebration p { color: #c1d2e6; }

/* The same language continues through practice, daily builds and dialogs. */
.daily-card, .quick-card { background: linear-gradient(145deg, #12243a, #0c192b); }
.daily-art, .welcome-illustration { background: radial-gradient(ellipse at center, #1c4165, #091423 80%); overflow: hidden; }
.daily-art { display: grid; place-items: center; padding: 12px; }
.daily-art > svg { display: block; width: 100%; height: auto; }
.daily-body h2 { font-weight: 600; letter-spacing: -.7px; }
.date-badge { color: var(--teal); border-color: #7bd7f03d; }
.quick-card legend { font-weight: 500; }
.choice:has(input:checked), .segment label:has(input:checked) { background: #7bd7f00a; border-color: #7bd7f078; color: var(--teal); }
dialog { background: linear-gradient(145deg, #182b43, #0b182a); border-color: #8eb3df38; }
dialog::backdrop { background: #020817c9; }
dialog h2 { font-weight: 600; letter-spacing: -.8px; }
dialog p { color: #b3c4dc; }
dialog[data-welcome] h2 { max-width: none; color: var(--ink); }
.welcome-illustration { display: grid; place-items: center; height: 160px; margin-top: 9px; border-color: #7bd7f029; }
.welcome-illustration > svg { display: block; width: 100%; height: 100%; }
.unlock-art { border: 1px solid var(--line); border-radius: 13px; margin: 4px 0 24px; overflow: hidden; background: #091423; }
.unlock-art > svg { display: block; width: 100%; height: auto; }
dialog .welcome-thanks { font-size: 16px; font-weight: 500; }
.learn-screen { background: radial-gradient(ellipse at 50% 30%, #1b426333, transparent 65%); }
.tutorial-heading h1 { font-weight: 600; letter-spacing: -1px; }
.tutorial-heading p, .tutorial-takeaway p { color: #bdcce0; }
.tutorial-takeaway { background: #7bd7f008; border-color: #7bd7f02c; }
.tutorial-takeaway strong { color: var(--teal); }
.tutorial-progress .current { background: #77c5e9; }
.toast { background: #182c43; color: var(--ink); border-color: #9bbcdf3d; }

.high-contrast { --muted: #d5e2f2; --line: #b8d6f380; }
.high-contrast .construction-board .board-cell.claimed { background: #ffd28c0b; }
.high-contrast .construction-board .board-cell.owner-1 { background: #7de7f50b; }
.high-contrast .construction-board .cell-owner { background: #030c16; }
.high-contrast .construction-board .cell-owner > .icon { width: 17px; height: 17px; }
.high-contrast .construction-board .edge.horizontal:not(.drawn) span { background: repeating-linear-gradient(90deg, #b7d2e9 0, #b7d2e9 5px, transparent 5px, transparent 11px); }
.high-contrast .construction-board .edge.vertical:not(.drawn) span { background: repeating-linear-gradient(0deg, #b7d2e9 0, #b7d2e9 5px, transparent 5px, transparent 11px); }
.high-contrast .village-levels .level-card.completed { border-color: var(--teal); }

@media (min-width: 1500px) {
  .construction-hero { gap: 30px 30px; padding-top: 80px; }
  .construction-hero .hero-model { margin-right: -30px; }
}
@media (max-width: 1150px) {
  .construction-hero { grid-template-columns: minmax(250px, 1fr) minmax(240px, 1fr); gap: 25px 8px; padding: 55px 35px 28px; min-height: 730px; }
  .construction-hero .hero-copy h1 { font-size: 49px; }
  .construction-hero .hero-tagline { font-size: 25px; }
  .construction-hero .hero-description { font-size: 12px; }
  .construction-hero .hero-model { margin-left: -25px; margin-right: -45px; }
  .construction-hero .welcome-actions { width: 295px; }
  .construction-hero .hero-note { display: flex; }
  .village-levels .level-house { height: 100px; }
}
@media (max-width: 950px) and (min-width: 801px) {
  .construction-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'copy' 'model' 'actions' 'note'; gap: 18px; padding: 45px 35px 25px; }
  .construction-hero .hero-copy { max-width: 470px; }
  .construction-hero .hero-model { width: 100%; max-width: 430px; margin: -15px auto; }
  .construction-hero .welcome-actions { width: 100%; max-width: 360px; }
}
@media (max-width: 800px) {
  .construction-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'copy' 'model' 'actions' 'note'; gap: 17px; padding: calc(93px + env(safe-area-inset-top, 0px)) 28px 27px; min-height: auto; }
  .construction-hero .hero-copy { text-align: center; margin: 0 auto; max-width: 450px; }
  .construction-hero .hero-copy h1 { font-size: 58px; margin: 13px 0 15px; }
  .construction-hero .hero-tagline { font-size: 26px; margin: auto; max-width: 350px; }
  .construction-hero .hero-description { font-size: 12px; max-width: 320px; margin: 13px auto 0; }
  .construction-hero .hero-copy > .eyebrow { font-size: 8px; letter-spacing: 1.6px; }
  .construction-hero .hero-model { width: min(100% + 24px, 540px); justify-self: center; margin: -17px -12px -18px; }
  .construction-hero .welcome-actions { width: 360px; margin: 0 auto; padding: 0; }
  .construction-hero .hero-kicker { text-align: center; }
  .construction-hero .hero-note { justify-content: center; text-align: left; max-width: 450px; justify-self: center; margin: 3px 0 0; padding-top: 21px; }
  .hero-model-label { font-size: 8px; letter-spacing: 1.4px; }
  .home-journey { padding-top: 33px; padding-bottom: 33px; }
  .home-journey-copy h2 { max-width: 380px; }
  .game-scenery.has-village { max-height: 215px; }
}
@media (max-width: 540px) {
  .construction-hero { padding-left: 23px; padding-right: 23px; gap: 16px; }
  .construction-hero .hero-copy h1 { font-size: 43px; letter-spacing: -2.3px; }
  .construction-hero .hero-tagline { font-size: 24px; max-width: 310px; }
  .construction-hero .hero-description { font-size: 11px; max-width: 290px; }
  .construction-hero .hero-model { margin-top: -12px; margin-bottom: -15px; }
  .construction-hero .welcome-actions { width: 100%; max-width: 360px; }
  .construction-hero .welcome-actions .primary { min-height: 56px; font-size: 16px; }
  .construction-hero .hero-copy > .eyebrow { font-size: 7px; letter-spacing: 1.5px; }
  .construction-hero .hero-note strong { font-size: 11px; }
  .construction-hero .hero-note p { font-size: 9px; }
  .page-heading h1 { font-size: 33px; letter-spacing: -1.2px; }
  .village-heading h2 { font-size: 30px; }
  .village-panorama { border-left: 0; border-right: 0; }
  .village-levels .level-card { min-height: 245px; padding: 20px 9px 17px; }
  .village-levels .level-house { height: 110px; margin: 9px 0 11px; }
  .village-levels .building-name { font-size: 14px; }
  .village-levels .level-description { font-size: 8px; }
  .keepsake-shelf h2 { font-size: 24px; }
  .keepsake strong { font-size: 11px; }
  .game-top h1 { font-size: 23px; }
  .score { font-size: 15px; }
  .score span { font-size: 15px; }
  .score strong { font-size: 26px; }
  .board-surround:has(.construction-board) { padding: 21px; border-radius: 15px; }
  .construction-board .dot { width: 11px; height: 11px; }
  .construction-board .cell-owner { padding: 2px; }
  .construction-board .cell-owner > .icon { width: 9px; height: 9px; }
  .game-message { font-size: 16px; }
  .completed-model { height: 180px; margin-bottom: 10px; }
  .assembly-progress { margin: 13px 8px; font-size: 9px; }
  .game-hint { padding: 0 7px; line-height: 1.6; }
  .daily-art { height: 255px; padding: 5px 22px; }
  .daily-art > svg { width: auto; max-width: 100%; height: 100%; }
  .daily-body { padding-top: 0; }
  .welcome-illustration { height: 150px; }
  .tutorial-heading h1 { font-size: 28px; }
}
@media (max-width: 360px) {
  .construction-hero { padding-left: 20px; padding-right: 20px; }
  .construction-hero .hero-copy h1 { font-size: 38px; }
  .construction-hero .hero-tagline { font-size: 22px; }
  .construction-hero .hero-copy > .eyebrow { font-size: 6.5px; letter-spacing: 1.1px; }
  .construction-hero .hero-note { gap: 10px; }
  .village-levels .level-house { height: 93px; }
  .village-levels .level-card { min-height: 230px; }
  .village-levels .building-name { font-size: 13px; }
  .game-top h1 { font-size: 21px; }
  .board-surround:has(.construction-board) { padding: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .construction-hero *, .construction-board * { animation: none !important; transition: none !important; }
}

/* Keep the missing part and its destination together throughout a match. */
.game-layout.piece-layout {
  grid-template-columns: minmax(0, 540px) minmax(250px, 340px);
  grid-template-areas: 'top top' 'board preview';
  gap: 25px clamp(22px, 3vw, 44px);
  max-width: 980px;
  align-items: start;
}
.piece-layout > .game-top { grid-area: top; margin: 0; }
.piece-layout > .game-top > div { min-width: 0; }
.piece-layout > .game-top h1 { overflow-wrap: anywhere; }
.piece-layout > .game-panel { grid-area: board; min-width: 0; }
.piece-layout > .piece-preview {
  grid-area: preview;
  display: grid;
  gap: 17px;
  min-width: 0;
  margin-top: 5px;
  padding: 24px 22px;
  border: 1px solid #88bddb36;
  border-radius: 20px;
  background: radial-gradient(ellipse at 50% 35%, #1c3c5a70, transparent 70%), #0d1b2d;
  box-shadow: 0 18px 40px #020b1729;
}
.piece-target { min-width: 0; }
.piece-target .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
.piece-target h2 { margin-top: 8px; font-size: 25px; line-height: 1.25; letter-spacing: -.6px; overflow-wrap: anywhere; }
.piece-target p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.piece-preview > .model-preview-art { min-width: 0; margin: -6px -10px; align-self: center; }
.model-preview-art > svg { display: block; width: 100%; height: auto; max-height: 340px; overflow: visible; pointer-events: none; }
.piece-status { padding: 10px 12px; border: 1px solid #83d7f142; border-radius: 9px; background: #77d9f00b; color: var(--teal); font-size: 12px; line-height: 1.55; }
.piece-status strong { color: var(--ink); font-weight: 600; }
.piece-status .icon { width: 15px; height: 15px; margin-right: 5px; }
.piece-progress { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; min-width: 0; font-size: 10px; line-height: 1.5; color: var(--muted); }
.piece-progress strong { color: var(--teal); font-weight: 500; }
.piece-progress .progress-track { grid-column: 1 / -1; width: 100%; height: 4px; }
.piece-help { padding-top: 15px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.75; color: var(--muted); }
.piece-help strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 5px; }
.piece-preview > .btn.text { min-height: 36px; padding: 3px 0; justify-content: flex-start; font-size: 11px; color: var(--teal); }
.piece-complete { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; border: 1px solid #85e7c86b; border-radius: 20px; padding: 7px 11px; background: #80e8bc0b; color: #a7f3cf; font-size: 10px; line-height: 1.4; }
.component-heading { text-align: center; margin: 0 10px 18px; }
.component-heading .eyebrow { font-size: 7px; letter-spacing: 1.6px; }
.component-heading h2 { margin-top: 4px; font-size: 24px; line-height: 1.3; letter-spacing: -.6px; }
.component-heading p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.component-board .assembly-art { pointer-events: none; }
.piece-layout .board-surround { width: 100%; }
.piece-layout .game-controls { margin-bottom: 8px; }

/* The practice board teaches the same part-to-project relationship. */
.tutorial-screen:has(.tutorial-workshop) { max-width: 720px; }
.tutorial-workshop { display: grid; grid-template-columns: minmax(0, 350px) minmax(180px, 270px); grid-template-areas: 'board preview'; align-items: center; justify-content: center; gap: 20px; margin: 20px auto; }
.tutorial-workshop > .tutorial-board { grid-area: board; min-width: 0; width: 100%; margin: 0; padding: 12px; }
.tutorial-model { grid-area: preview; min-width: 0; padding: 17px; border: 1px solid #85bcdd30; border-radius: 15px; background: radial-gradient(ellipse at 50% 40%, #22435c55, transparent 75%), #0c1a2b; }
.tutorial-model > svg, .tutorial-model .model-preview-art > svg { display: block; width: 100%; height: auto; max-height: 245px; }
.tutorial-model .eyebrow { font-size: 7px; letter-spacing: 1.2px; }
.tutorial-model h2, .tutorial-model h3 { font-size: 19px; line-height: 1.3; margin-top: 6px; letter-spacing: -.4px; }
.tutorial-model p { font-size: 10px; line-height: 1.6; color: var(--muted); }
.tutorial-model .piece-status { margin-top: 8px; font-size: 10px; padding: 8px; color: var(--teal); }

@media (max-width: 1060px) {
  .game-layout.piece-layout { grid-template-columns: minmax(0, 560px); grid-template-areas: 'top' 'preview' 'board'; gap: 18px; }
  .piece-layout > .piece-preview {
    grid-template-columns: minmax(100px, 140px) minmax(0, 1fr);
    grid-template-areas: 'art target' 'art status' 'progress progress';
    gap: 9px 16px;
    align-items: center;
    margin: 0;
    padding: 14px 18px 13px;
    border-radius: 15px;
  }
  .piece-preview > .piece-target { grid-area: target; align-self: end; }
  .piece-preview > .model-preview-art { grid-area: art; margin: -6px; }
  .piece-preview > .model-preview-art > svg { max-height: 140px; }
  .piece-preview > .piece-status { grid-area: status; align-self: start; }
  .piece-preview > .piece-progress { grid-area: progress; gap: 6px 10px; }
  .piece-preview > .piece-help, .piece-preview > .btn.text { display: none; }
  .piece-preview .piece-target h2 { font-size: 22px; margin-top: 4px; }
  .piece-preview .piece-target p { display: none; }
  .piece-preview .piece-status { font-size: 11px; padding: 7px 9px; }
  .piece-preview .piece-target .eyebrow { font-size: 7px; }
  .component-heading { margin-bottom: 15px; }
}
@media (max-width: 800px) {
  .game-layout.piece-layout { max-width: 560px; gap: 16px; }
  .piece-layout > .game-top { padding-top: env(safe-area-inset-top, 0px); }
}
@media (max-width: 540px) {
  .game-layout.piece-layout { gap: 15px; }
  .piece-layout > .game-top h1 { font-size: 21px; line-height: 1.25; }
  .piece-layout > .piece-preview { grid-template-columns: 106px minmax(0, 1fr); gap: 7px 11px; padding: 11px 13px; }
  .piece-preview > .model-preview-art > svg { max-height: 112px; }
  .piece-preview .piece-target h2 { font-size: 18px; letter-spacing: -.45px; }
  .piece-preview .piece-target .eyebrow { font-size: 6px; letter-spacing: 1px; }
  .piece-preview .piece-status { font-size: 10px; padding: 6px 8px; border-radius: 7px; }
  .piece-preview .piece-progress { font-size: 9px; gap: 5px 8px; }
  .component-heading { margin-bottom: 13px; }
  .component-heading h2 { font-size: 21px; }
  .component-heading p { font-size: 10px; margin-top: 4px; }
  .piece-layout .turn-row { margin-top: 16px; margin-bottom: 17px; }
  .tutorial-workshop { grid-template-columns: minmax(0, 350px); grid-template-areas: 'preview' 'board'; gap: 8px; margin: 15px auto; }
  .tutorial-model { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 12px; }
  .tutorial-model > svg, .tutorial-model > .model-preview-art { grid-column: 1; grid-row: 1 / span 4; width: 100%; margin: 0; }
  .tutorial-model > svg, .tutorial-model .model-preview-art > svg { max-height: 115px; }
  .tutorial-model > :not(svg):not(.model-preview-art) { grid-column: 2; }
  .tutorial-model h2, .tutorial-model h3 { font-size: 17px; }
  .tutorial-model .piece-status { margin-top: 4px; padding: 6px 7px; }
  .tutorial-workshop > .tutorial-board { padding: 14px 17px; }
}
@media (max-width: 360px) {
  .piece-layout > .game-top h1 { font-size: 19px; }
  .piece-layout > .piece-preview { grid-template-columns: 90px minmax(0, 1fr); gap: 7px 9px; padding: 10px; }
  .piece-preview .piece-target h2 { font-size: 16px; }
  .piece-preview .piece-status { font-size: 9px; padding: 6px; }
  .piece-preview > .model-preview-art > svg { max-height: 100px; }
  .component-heading h2 { font-size: 19px; }
  .tutorial-model { grid-template-columns: 88px minmax(0, 1fr); gap: 8px; padding: 10px; }
}
.high-contrast .piece-preview, .high-contrast .tutorial-model, .high-contrast .piece-status { border-color: #c5e9ffb3; }
.high-contrast .piece-status { color: #d8f9ff; background: #062137; }
.high-contrast .piece-complete { border-color: #b7ffdf; color: #c5ffe4; }
@media (prefers-contrast: more) {
  .piece-layout > .piece-preview, .tutorial-model, .piece-status { border-color: #c5e9ffb3; }
  .piece-status { color: #d8f9ff; background: #062137; }
}
@media (prefers-reduced-motion: reduce) {
  .piece-preview *, .tutorial-model *, .component-board * { animation: none !important; transition: none !important; }
}
