/* Compact library and template picker. These styles are independent of game themes. */
button, input, select, textarea { font: inherit; }
@font-face { font-family: "ClassPlay Round"; src: url("../assets/fonts/Nunito-Variable.woff2") format("woff2"); font-style: normal; font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "ClassPlay Display"; src: url("../assets/fonts/Baloo2-Variable.woff2") format("woff2"); font-style: normal; font-weight: 400 800; font-display: swap; }
body.site-page { margin: 0; background: linear-gradient(#cce6f3, #e8f5fb 450px); color: #222; font-family: Arial, "Microsoft YaHei", sans-serif; font-size: 14px; font-weight: 400; }
.site-header { background: #fff; border-bottom: 1px solid #dae8ef; }
.site-header-inner { min-height: 50px; display: flex; align-items: center; gap: 22px; padding: 0 30px; max-width: 1600px; margin: auto; }
.site-brand { display: inline-flex; align-items: center; gap: 5px; color: #222; font-size: 24px; font-weight: 700; letter-spacing: -1.1px; line-height: 1; white-space: nowrap; }
.site-brand { font-family: "ClassPlay Round", Arial, sans-serif; font-weight: 900; }
.iq-activity-svg text { font-family: "ClassPlay Round", Nunito, Arial, sans-serif; }
.site-logo { display: grid; grid-template-columns: 9px 9px; grid-template-rows: 9px 9px; gap: 2px; margin-right: 1px; }
.site-logo i { display: block; width: 9px; height: 9px; background: #33a4e4; }
.site-logo i:nth-child(2) { opacity: .58; }.site-logo i:nth-child(3) { opacity: .72; }
.site-nav { display: flex; align-items: center; gap: 25px; margin-left: auto; align-self: stretch; }
.site-nav a { display: flex; align-items: center; border-bottom: 2px solid transparent; font-size: 13px; color: #222; padding: 0 2px; }
.site-nav a:hover, .site-nav a[aria-current] { border-bottom-color: #39a4e5; color: #1573ad; }
/* Tool navigation uses the same understated accent as the worksheet controls. */
.site-page:is(.tools-page, .tracing-page) .site-header .site-nav a[aria-current="page"] { color: #176b9b; border-bottom: 2px solid #176b9b; background: transparent; box-shadow: none; }
.site-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #bbb; background: linear-gradient(#fff, #f6f6f6); color: #222; font: inherit; font-size: 13px; font-weight: 400; padding: 7px 12px; border-radius: 0; min-height: 34px; line-height: 1.25; cursor: pointer; white-space: nowrap; }
.site-button:hover { background: #eef6fc; border-color: #7cb9dd; }
.site-button.primary { color: #fff; background: #39a5e8; border-color: #339add; font-weight: 600; }
.site-button.primary:hover { background: #268ecb; }
.site-create { min-height: 32px; font-size: 13px; padding: 6px 13px; }
.site-main { width: calc(100% - 72px); max-width: 1280px; min-height: calc(100vh - 136px); margin: 24px auto 0; background: #fff; box-shadow: 0 1px 5px rgba(70,95,110,.08); }
.site-page .site-input, .site-page .site-select { font-family: inherit; font-size: 13px; font-weight: 400; color: #333; height: 35px; min-width: 0; border: 1px solid #c6c6c6; border-radius: 0; background: #fff; outline: none; padding: 7px 10px; box-shadow: none; }
.site-page .site-input:focus, .site-page .site-select:focus { border-color: #40a6e0; box-shadow: 0 0 0 1px #40a6e0; }
.site-input::placeholder { color: #aaa; }
.site-input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.site-page button:focus-visible, .site-page a:focus-visible { outline: 2px solid #267fb6; outline-offset: 3px; }
.picker-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 25px; border-bottom: 1px solid #e4e4e4; padding: 27px 32px 24px; }
.picker-steps { display: flex; align-items: center; gap: 16px; font-size: 20px; color: #898989; line-height: 1.2; white-space: nowrap; }
.picker-steps h1 { font-size: 20px; font-weight: 400; color: #111; line-height: inherit; margin: 0; letter-spacing: 0; }
.step-chevron { color: #8e8e8e; font-size: 30px; font-weight: 300; line-height: .6; }
.compact-search { position: relative; flex: 0 1 210px; }
.compact-search .site-input { width: 100%; padding-right: 30px; }
.compact-search > span { display: grid; place-items: center; position: absolute; right: 10px; top: 0; height: 35px; color: #444; pointer-events: none; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; padding: 26px 32px 40px; }
.template-card { display: flex; min-width: 0; height: 122px; border: 1px solid #d7d7d7; background: #fff; color: #111; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: background .15s, border-color .15s; overflow: hidden; }
.template-card:hover { border-color: #72bce9; background: #f3faff; }
.template-thumb { flex: 0 0 120px; width: 120px; height: 120px; display: block; background: #e9f5fc; }
.iq-template-svg { display: block; width: 100%; height: 100%; }
.template-card .template-copy { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; padding: 13px 14px 13px 18px; }
.template-copy h2 { font-size: 16px; font-weight: 400; line-height: 1.15; margin: 0; }
.template-copy p { margin: 0; font-size: 13px; font-weight: 400; line-height: 1.35; color: #696969; }
.site-empty { grid-column: 1 / -1; padding: 50px 20px; text-align: center; color: #777; }
.site-empty h2 { font-weight: 400; color: #333; font-size: 20px; }
.site-empty p { font-size: 14px; }
.library-heading { display: flex; align-items: center; gap: 22px; min-height: 75px; padding: 19px 27px; border-bottom: 4px solid #d4e8f2; }
.library-heading h1 { font-size: 25px; font-weight: 600; letter-spacing: 0; margin: 0 auto 0 0; line-height: 1.25; }
.library-title { margin-right: auto; min-width: 0; }
.library-title h1 { overflow-wrap: anywhere; }
.library-tools { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.library-view-controls { display: flex; gap: 3px; }
.library-view-controls .site-button { width: 34px; padding: 0; color: #7895a6; }
.library-view-controls .site-button[aria-pressed=true] { color: #258fc9; border-color: #83b9da; background: #eaf6fc; }
.library-search { position: relative; width: 240px; }
.library-search .site-input { width: 100%; padding-right: 37px; }
.library-search > span { display: grid; place-items: center; position: absolute; right: 0; top: 0; width: 35px; height: 35px; border-left: 1px solid #c6c6c6; font-size: 24px; color: #333; pointer-events: none; }
.library-order-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 50px; padding: 12px 27px 7px; color: #555; font-size: 12px; }
.library-sort-options { display: flex; align-items: center; gap: 17px; }
.library-sort-options button { font: inherit; font-size: 12px; font-weight: 400; padding: 2px 0; border: none; background: none; color: #666; }
.library-sort-options button[aria-pressed=true] { color: #111; }
.library-sort-options button[aria-pressed=true]::after { content: " ▴"; }
.library-order-row .site-select { height: 29px; padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.library-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 19px 15px; padding: 16px 27px 40px; align-content: start; }
.library-card { position: relative; min-width: 0; border: 1px solid #ccc; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.library-card:hover { border-color: #79bde5; }
.activity-thumb { display: block; width: 100%; aspect-ratio: 4/3; background: #d4eaf7; overflow: hidden; }
.activity-thumb svg, .activity-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.activity-details { padding: 8px 9px 28px; min-height: 81px; }
.activity-details h2 { margin: 0 0 5px; font-size: 15px; font-weight: 400; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-details h2 a { color: #111; }
.activity-details h2 a:hover { color: #197cba; }
.activity-template-name { margin: 0; font-size: 11px; color: #888; line-height: 1.25; }
.activity-meta { position: absolute; bottom: 7px; left: 9px; right: 40px; margin: 0; font-size: 10px; font-weight: 400; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-menu { position: absolute; right: 3px; bottom: 4px; }
.activity-menu > summary { list-style: none; display: grid; place-items: center; width: 32px; height: 28px; border-left: 1px solid #eee; color: #555; cursor: pointer; font-size: 21px; line-height: 1; }
.activity-menu > summary::-webkit-details-marker { display: none; }
.activity-menu[open] > summary { color: #1887c8; background: #eef8ff; }
.activity-actions { position: absolute; z-index: 15; right: 0; top: 32px; width: 150px; display: flex; flex-direction: column; background: #fff; padding: 4px 0; border: 1px solid #bbb; box-shadow: 0 3px 12px rgba(0,0,0,.14); }
.activity-action { display: block; text-align: left; width: 100%; border: 0; background: #fff; font: inherit; font-size: 13px; font-weight: 400; color: #333; padding: 9px 14px; cursor: pointer; }
.activity-action:hover { color: #147bb9; background: #edf8ff; }
.activity-action.delete-action { color: #a04e49; border-top: 1px solid #eee; }
.folder-card { position: relative; align-self: start; min-height: 112px; margin-top: 8px; padding: 21px 18px 32px; border-radius: 0 4px 4px 4px; background: #8cc7e9; border-top: 7px solid #6dafd5; color: #111; box-shadow: inset 6px 0 #67afd8; }
.folder-card::before { content: ""; position: absolute; width: 38%; height: 9px; left: 0; top: -15px; border-radius: 6px 8px 0 0; background: #6dafd5; }
.folder-card h2 { font-size: 15px; font-weight: 400; margin: 0 0 7px; line-height: 1.2; overflow-wrap: anywhere; }
.folder-card p { margin: 0; font-size: 11px; color: #557c93; }
.folder-card .activity-menu > summary { border-left: 1px solid rgba(43,104,141,.2); }
.folder-open::after { content: ""; position: absolute; inset: 0; }
.folder-card .activity-menu { z-index: 3; }
.library-breadcrumb { color: #777; font-size: 12px; margin: 0 0 7px; }
.library-breadcrumb a { color: #333; }.library-breadcrumb span { padding: 0 10px; }
.folder-up { display: grid; place-items: center; min-height: 112px; padding: 14px; font-size: 35px; width: 145px; color: #579bbb; border: 0; font-weight: 400; }
.library-notice { padding: 16px 27px 0; font-size: 12px; color: #888; }
.library-notice a { color: #1789cb; }
.site-dialog { width: min(460px, calc(100vw - 32px)); border: 1px solid #bbb; background: #fff; color: #333; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.site-dialog::backdrop { background: rgba(30,55,75,.4); }
.site-dialog h2 { font-size: 21px; font-weight: 400; margin: 0 0 22px; }
.site-dialog label { display: block; color: #555; font-size: 13px; margin-bottom: 8px; }
.site-dialog .site-input, .site-dialog .site-select { width: 100%; }
.site-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.site-page .toast-msg { bottom: 25px; font-family: Arial, sans-serif; }
.library-list[data-view=list] { grid-template-columns: minmax(0, 1fr); }
.library-list[data-view=list] .library-card { display: grid; grid-template-columns: 128px minmax(0, 1fr); max-width: none; }
.library-list[data-view=list] .activity-thumb { height: 96px; }
.library-list[data-view=list] .activity-details { padding: 17px 50px 27px 20px; min-height: 96px; }
.library-list[data-view=list] .activity-meta { left: 148px; bottom: 14px; }
.library-list[data-view=list] .folder-card { max-width: none; min-height: 90px; }
.site-footer { max-width: 1280px; margin: 0 auto; padding: 17px 0 24px; color: #7490a2; font-size: 10px; text-align: center; line-height: 1.5; }
.site-footer p { margin: 3px 0; }
@media (max-width: 1100px) {
  .template-grid { gap: 17px; padding: 24px; }.picker-toolbar { padding-left: 24px; padding-right: 24px; }
  .template-thumb { flex-basis: 105px; width: 105px; height: 120px; }.template-copy p { font-size: 12px; }.template-card .template-copy { padding-left: 13px; }
  .library-heading { flex-wrap: wrap; }.library-tools { flex: 1; }.library-heading h1 { font-size: 24px; }
  .library-search { width: 210px; }
}
@media (max-width: 900px) {
  .site-main { width: calc(100% - 40px); margin-top: 20px; }.template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-thumb { flex-basis: 120px; width: 120px; }.picker-steps, .picker-steps h1 { font-size: 18px; }.picker-steps { gap: 12px; }.compact-search { flex-basis: 180px; }
  .library-list { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }.library-search { width: 180px; }.library-heading { gap: 15px; }
}
@media (max-width: 650px) {
  .site-header-inner { padding: 0 15px; gap: 12px; min-height: 51px; }.site-brand { font-size: 21px; }.site-nav { gap: 13px; }.site-nav a { font-size: 11px; }.site-create { font-size: 11px; padding: 6px 9px; }
  .site-main { width: calc(100% - 24px); margin-top: 14px; }.picker-toolbar { padding: 23px 17px 19px; flex-wrap: wrap; gap: 18px; }.picker-steps { gap: 11px; font-size: 16px; }.picker-steps h1 { font-size: 16px; }.step-chevron { font-size: 24px; }.compact-search { flex-basis: 100%; }
  .template-grid { padding: 19px 17px 30px; gap: 13px; grid-template-columns: minmax(0, 1fr); }.template-card .template-copy { padding-left: 18px; }.template-copy p { font-size: 13px; }
  .library-heading { padding: 17px; }.library-heading h1 { font-size: 23px; }.library-tools { justify-content: flex-start; flex-basis: 100%; }.library-search { flex: 1; width: auto; min-width: 130px; }
  .library-order-row { padding: 12px 17px; gap: 12px; flex-wrap: wrap; }.library-sort-options { gap: 11px; margin-left: auto; font-size: 11px; }.library-sort-options button { font-size: 11px; }
  .library-list { padding: 10px 17px 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }.activity-details { padding: 8px 8px 29px; }.activity-details h2 { font-size: 13px; }.activity-template-name { font-size: 10px; }.activity-meta { font-size: 9px; left: 8px; }
  .folder-card { min-height: 100px; padding: 16px 12px 30px; }.folder-card h2 { font-size: 13px; }.folder-card p { font-size: 10px; }.folder-up { width: 100%; }
  .site-footer { padding: 15px 20px 20px; }
}
@media (max-width: 420px) {
  .site-nav a#templatesNav { display: none; }.site-header-inner { gap: 8px; }.site-nav { gap: 0; }
  .picker-steps, .picker-steps h1 { font-size: 14px; }.picker-steps { gap: 7px; }.step-chevron { font-size: 20px; }
  .template-thumb { flex-basis: 100px; width: 100px; }.template-card .template-copy { padding: 11px 10px 11px 12px; }.template-copy p { font-size: 12px; }
  .library-list { grid-template-columns: minmax(0, 1fr); }.library-card { max-width: 260px; width: 100%; }.folder-card { max-width: 260px; }.folder-up { width: 130px; }
}
@media (prefers-reduced-motion: reduce) { :where(:root:not([data-motion-managed])) .template-card { transition: none; } }/* The player's own "No movement" choice (html[data-reduce-motion], js/motion-preference.js) applies the same rules. */:where(:root[data-reduce-motion]) .template-card { transition: none; }
