@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;800&display=swap');
/* 01. Tema, reinicio y controles compartidos.
 * Mapa de estilos: ../docs/maintenance.md.
 * El orden de reglas y media queries es intencional: las últimas sobrescriben
 * algunas anteriores. No agruparlas por selector sin revisar la cascada.
 */
:root {
  font-family: 'DM Sans', sans-serif;
  color: #252a35;
  background: #f4f5f7;
  font-synthesis: none;
  font-size: 14px;
  --ink: #171b25;
  --line: #e8eaee;
  --muted: #828793;
  --lime: #b8ed80;
  --accent: #6f53cc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  opacity: 0.32;
  cursor: default;
}
button,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #8d70dc;
}
button {
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  background-color: #f0edf9;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  flex-shrink: 0;
}
button span[data-icon] {
  display: inline-flex;
}
h1,
h2,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
/* 02. Cabecera, identidad y acciones principales. */
.topbar {
  height: 82px;
  background: var(--ink);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 27px;
  gap: 30px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-family: Manrope, sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -1px;
}
.brand-mark {
  display: grid;
  grid-template-columns: 10px 10px;
  gap: 3px;
  transform: rotate(-8deg);
  margin-right: 2px;
}
.brand-mark i {
  width: 10px;
  height: 10px;
  background: var(--lime);
  border-radius: 2px;
}
.brand-mark i:last-child {
  border-radius: 50%;
}
.brand-divider {
  height: 27px;
  width: 1px;
  background: #424550;
  margin: 0 7px 0 14px;
}
.brand-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 2px;
  font-weight: 500;
  max-width: 62px;
}
.project-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 1px solid #343844;
  padding-left: 30px;
  flex: 1;
}
.project-name input {
  background: transparent;
  border: 0;
  color: #f7f7fa;
  font-weight: 500;
  max-width: 350px;
  width: 100%;
  padding: 0;
  font-size: 14px;
}
.project-name > span {
  font-size: 11px;
  color: #9caa98;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.button {
  border: 1px solid #e1e3e8;
  border-radius: 7px;
  background: white;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 550;
  font-size: 13px;
  white-space: nowrap;
}
.topbar .button {
  color: #dfe2ea;
  background: #272c36;
  border-color: #41454e;
}
.topbar .button:hover {
  background: #363d48;
}
.topbar .button.primary {
  background: var(--lime);
  border-color: var(--lime);
  color: #213114;
  font-weight: 700;
}
.topbar .button.primary:hover {
  background: #cafa9a;
}
.topbar .icon-button {
  color: #bcc2cc;
  border: 1px solid #424753;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 13px;
  margin-right: 8px;
}
/* 03. Distribución general y panel de biblioteca. */
.workspace {
  display: grid;
  grid-template-columns: 246px minmax(200px, 1fr) 266px;
  height: calc(100dvh - 82px);
  min-height: 600px;
}
.panel {
  background: white;
  min-height: 0;
  display: flex;
  flex-direction: column;
  z-index: 1;
}
.library {
  border-right: 1px solid var(--line);
  overflow: auto;
}
.panel-heading {
  padding: 26px 20px 23px;
}
.panel-heading h1 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.3px;
}
.eyebrow {
  display: block;
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #979ba5;
  margin-top: 8px;
}
.left-tabs,
.inspector-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  gap: 24px;
}
.left-tabs button,
.inspector-tabs button {
  border: 0;
  background: none;
  padding: 12px 0;
  font-size: 13px;
  color: var(--muted);
  position: relative;
}
.left-tabs button.active,
.inspector-tabs button.active {
  color: var(--ink);
  font-weight: 650;
}
.left-tabs button.active:after,
.inspector-tabs button.active:after {
  content: '';
  height: 2px;
  background: var(--ink);
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
}
/* 04. Paletas de figuras, cuadrículas, fichas, colores y plantillas. */
.library-section {
  padding: 23px 20px 0;
}
.library-section h2,
.property-section h2 {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #7f8591;
  font-weight: 650;
  margin-bottom: 14px;
}
.shape-palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.shape-palette button {
  height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fafbfc;
  border: 1px solid #eceef1;
  border-radius: 7px;
  font-size: 11px;
  color: #6c7280;
}
.shape-palette svg {
  width: 26px;
  height: 26px;
  stroke: #626b7c;
  stroke-width: 1.4;
  fill: #edf0f5;
}
.section-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
}
.small-badge {
  font-size: 9px;
  color: #8c76b0;
}
.grid-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 13px 10px;
  background: #f4f0fb;
  border: 1px solid #e6dcf6;
  border-radius: 7px;
}
.grid-card b {
  display: block;
  font-size: 11px;
  font-weight: 600;
}
.grid-card small {
  font-size: 10px;
  display: block;
  color: #8c839a;
  margin-top: 4px;
}
.mini-grid {
  width: 30px;
  height: 30px;
  border: 1px solid #a38ac9;
  flex-shrink: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 9px, #a38ac9 9px 10px),
    repeating-linear-gradient(90deg, transparent 0 9px, #a38ac9 9px 10px);
}
.plus {
  margin-left: auto;
  color: #9072b5;
}
.game-palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.game-palette button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  height: 79px;
  font-size: 11px;
  color: #6c7280;
}
.token-preview {
  display: flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  background: #ecdebc;
  border: 3px solid #fbf4e5;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d8bd80;
  color: #8c6e30;
  font-size: 12px;
}
.card-preview {
  width: 22px;
  height: 30px;
  border: 1.5px solid #789b89;
  background: #edf5ef;
  border-radius: 4px;
  font-size: 20px;
}
.text-preview {
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 30px;
  color: #687083;
}
.colors {
  display: flex;
  gap: 10px;
}
.swatch {
  border: 2px solid white;
  border-radius: 50%;
  width: 23px;
  height: 23px;
  box-shadow: 0 0 0 1px #e8e9ee;
  padding: 0;
}
.swatch:hover {
  transform: scale(1.15);
}
.small {
  font-size: 10px;
}
.muted {
  color: var(--muted);
}
.library-section p {
  margin-top: 13px;
}
.library-bottom {
  margin-top: auto;
  padding: 28px 20px 20px;
  color: #6f7786;
}
.library-bottom > span svg {
  width: 23px;
  height: 23px;
  stroke: #a4aa91;
  margin-bottom: 8px;
}
.library-bottom b {
  display: block;
  font-size: 11px;
  font-weight: 500;
}
.library-bottom p {
  font-size: 11px;
  line-height: 1.7;
  color: #a0a5ad;
  margin-top: 5px;
}
.text-button {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 22px;
}
.template {
  width: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: white;
  text-align: left;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}
.template-art {
  width: 100%;
  padding: 23px;
  background: #f3f0f8;
  border-radius: 4px;
  text-align: center;
  color: #8d75b2;
  font-size: 22px;
}
.template b {
  font-size: 12px;
  margin: 12px 0 6px;
}
.template small {
  font-size: 10px;
  color: var(--muted);
}
.hex-art {
  background: #eef5ed;
  color: #78a47a;
}
/* 05. Lienzo SVG, herramientas, navegación y estado. */
.editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.canvas-toolbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  flex-shrink: 0;
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 7px;
}
.icon-button {
  border: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  color: #787f8c;
}
.icon-button.active {
  background: #eee9f7;
  color: #7755b4;
}
.separator {
  height: 20px;
  width: 1px;
  background: var(--line);
  margin: 0 6px;
}
.toggle-label {
  font-size: 11px;
  color: #6e7582;
  display: flex;
  gap: 7px;
  align-items: center;
  cursor: pointer;
}
.toggle-label input {
  accent-color: #8464bb;
  width: 12px;
}
.canvas-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #f2f3f5;
}
.canvas-caption {
  position: absolute;
  top: 24px;
  left: 27px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 1.3px;
  color: #9a9faa;
  pointer-events: none;
}
.canvas-caption span:last-child {
  letter-spacing: 0.3px;
}
.page-dot {
  width: 6px;
  height: 6px;
  background: #b6bdc7;
  border-radius: 2px;
}
#canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}
#paper {
  filter: drop-shadow(0px 4px 10px #16203714);
}
#objects > g {
  cursor: move;
}
#objects > g.locked {
  cursor: default;
}
#objects > g text {
  pointer-events: none;
}
#selection {
  pointer-events: none;
}
#selection .resize-handle {
  pointer-events: all;
  cursor: nwse-resize;
}
.canvas-hint {
  position: absolute;
  bottom: 23px;
  left: 26px;
  font-size: 9px;
  color: #9b9faa;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
kbd {
  font: inherit;
  font-size: 9px;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 3px;
  padding: 3px 5px;
  color: #777f8b;
}
.zoom-controls {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  background: white;
  box-shadow: 0 2px 8px #18243e0b;
  border: 1px solid #e4e6eb;
  border-radius: 7px;
  padding: 4px;
}
.zoom-controls button {
  border: 0;
  background: white;
  height: 28px;
  min-width: 28px;
  color: #78808e;
  font-size: 15px;
}
.zoom-controls #zoom-level {
  font-size: 10px;
  width: 43px;
}
.statusbar {
  height: 35px;
  background: white;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 19px;
  color: #9197a2;
  font-size: 9px;
}
.statusbar > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a8b79b;
}
.status-separator {
  color: #cdd1d9;
  margin: 0 5px;
}
#mode-status {
  letter-spacing: 0.7px;
}
/* 06. Inspector y campos de propiedades. */
.inspector {
  border-left: 1px solid var(--line);
  overflow: auto;
}
.inspector-tabs {
  gap: 25px;
  padding-top: 10px;
  height: 58px;
  flex-shrink: 0;
}
.inspector-tabs button {
  font-size: 12px;
}
.inspector-tabs button span {
  margin-left: 4px;
  font-size: 9px;
  background: #f0f1f4;
  border-radius: 4px;
  padding: 2px 4px;
}
.property-section {
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
}
.property-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.property-title > span {
  width: 35px;
  height: 35px;
  background: #f1ecf8;
  color: #8864bd;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.property-title svg {
  width: 20px;
  height: 20px;
}
.property-title b {
  font-size: 13px;
  font-weight: 600;
  display: block;
}
.property-title small {
  display: block;
  font-size: 10px;
  color: #9499a2;
  margin-top: 4px;
}
.field-label {
  font-size: 10px;
  display: block;
  color: #878e9a;
  margin-bottom: 7px;
}
.field {
  width: 100%;
  border: 1px solid #e5e7ed;
  background: #fafbfc;
  border-radius: 5px;
  padding: 9px 10px;
  color: #596172;
  font-size: 12px;
  min-width: 0;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.field-wrap {
  position: relative;
}
.field-wrap > span {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  color: #a5aab4;
  pointer-events: none;
}
.field-wrap > .field {
  padding-left: 29px;
}
.field-wrap > span.unit {
  left: auto;
  right: 10px;
}
.field-wrap > .unit + .field {
  padding-left: 10px;
  padding-right: 29px;
}
.full-label {
  display: block;
  margin-top: 13px;
  font-size: 10px;
  color: #9298a4;
}
.full-label .field {
  margin-top: 6px;
}
.align-buttons {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 10px;
}
.align-buttons button {
  flex: 1;
  border: 1px solid var(--line);
  height: 30px;
  background: #fff;
  color: #9299a4;
  font-size: 17px;
  border-radius: 4px;
}
.color-field {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fafbfc;
  border: 1px solid #e5e7ed;
  border-radius: 5px;
  padding: 6px 9px;
  font-size: 11px;
  color: #7b8290;
}
.color-field input {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.property-section textarea {
  resize: vertical;
  min-height: 60px;
}
.property-section .button {
  font-size: 11px;
  padding: 8px;
}
.actions-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.actions-row .button {
  flex: 1;
}
.property-note {
  font-size: 11px;
  line-height: 1.7;
  color: #969ca7;
  margin-top: 12px;
}
.range {
  width: 100%;
  accent-color: #9577c2;
  margin-top: 12px;
}
.inspector-bottom {
  margin-top: auto;
  padding: 21px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: #a2a7b0;
  font-size: 10px;
  line-height: 1.6;
}
.inspector-bottom svg {
  width: 22px;
  height: 22px;
  stroke: #a8adb7;
}
.inspector-bottom b {
  font-weight: 400;
  color: #7b838f;
}
/* 07. Lista de capas y controles de orden. */
.layer-row {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f1f4;
}
.layer-row.selected {
  background: #f1edf9;
}
.layer-select {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: none;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-row .icon-button {
  width: 25px;
  height: 25px;
  font-size: 12px;
}
.layer-row .icon-button svg {
  width: 14px;
  height: 14px;
}
.layer-row .icon-button[data-dimmed] {
  opacity: 0.3;
}
.layer-controls {
  display: flex;
  gap: 8px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.layer-controls .button {
  font-size: 11px;
  flex: 1;
  padding: 8px;
}
/* 08. Avisos, diálogos y ayuda. */
#toast {
  position: fixed;
  left: 50%;
  bottom: 50px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: #222936;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 5px 25px #0002;
  font-size: 13px;
  z-index: 10;
  transition: 0.2s;
  max-width: 90vw;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
dialog {
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  padding: 32px;
  max-width: 490px;
  width: calc(100vw - 32px);
  box-shadow: 0 20px 100px #0003;
}
dialog::backdrop {
  background: #171b2555;
  backdrop-filter: blur(4px);
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 22px;
}
dialog h2 {
  font:
    700 23px Manrope,
    sans-serif;
  margin-bottom: 12px;
}
dialog p {
  font-size: 14px;
  line-height: 1.7;
  color: #7a8190;
  margin: 10px 0 20px;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-actions .button {
  justify-content: flex-start;
  padding: 14px;
}
.modal-actions small {
  margin-left: auto;
  color: #969ca7;
  font-weight: 400;
}
.shortcut-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f1f4;
  font-size: 12px;
}
.shortcut-row kbd {
  font-size: 11px;
}
/* 09. Modo de prueba y resultados de acciones manuales. */
#simulation-bar {
  background: #eef4e7;
  border-bottom: 1px solid #dce8d0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  flex-wrap: wrap;
}
#simulation-bar > span {
  flex: 1;
  color: #748064;
}
#simulation-bar .button {
  padding: 6px 10px;
  font-size: 10px;
}
.simulation .library {
  opacity: 0.55;
}
.simulation #objects > g {
  cursor: default;
}
.simulation #objects > g.playable {
  cursor: grab;
}
.die-result {
  font:
    800 52px Manrope,
    sans-serif;
  color: #7b5da9;
  text-align: center;
  padding: 15px;
  background: #f2edf8;
  border-radius: 10px;
  margin: 15px 0;
}
.play-log {
  font-size: 11px;
  color: #8a919d;
  line-height: 1.8;
  max-height: 160px;
  overflow: auto;
  margin-top: 13px;
}
.danger {
  color: #bd6370 !important;
}
.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: #7f8795;
  margin-top: 14px;
}
.check-row input {
  accent-color: #9372c2;
}
/* 10. Ajustes de legibilidad que prevalecen sobre los tamaños base. */
.left-tabs button,
.inspector-tabs button,
.button,
.field,
.project-name input {
  font-size: 14px;
}
.shape-palette button,
.game-palette button,
.grid-card b,
.text-button {
  font-size: 13px;
}
.field-label,
.full-label,
.check-row,
.toggle-label,
.property-section .button,
.layer-select,
.layer-controls .button {
  font-size: 12px;
}
.property-note {
  font-size: 13px;
  line-height: 1.7;
}
.grid-card small,
.small,
.library-bottom b,
.library-bottom p,
.inspector-bottom,
.property-title small,
.project-name > span {
  font-size: 11px;
}
.property-title b {
  font-size: 14px;
}
.canvas-hint,
.statusbar,
.canvas-caption {
  font-size: 10px;
}
.panel::-webkit-scrollbar {
  width: 5px;
}
.panel::-webkit-scrollbar-thumb {
  background: #dfe2e8;
  border-radius: 6px;
}
.panel::-webkit-scrollbar-track {
  background: transparent;
}
.field-wrap {
  display: block;
}
.field-row > label {
  min-width: 0;
}
/* 11. Biblioteca de tableros guardados y sus ajustes de pantalla. */
.boards-launcher {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 22px;
  color: #654a94;
  background: #f4effa;
  border-color: #e3d9f0;
}
.boards-dialog {
  max-width: 840px;
  max-height: 85dvh;
  overflow: auto;
}
.board-library-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 22px;
}
.saved-boards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.saved-board {
  border: 1px solid #e5e7ed;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.saved-board.current {
  border-color: #9473c6;
  box-shadow: 0 0 0 1px #9473c6;
}
.board-open {
  display: block;
  border: 0;
  background: white;
  width: 100%;
  text-align: left;
  padding: 12px;
}
.board-thumbnail {
  height: 120px;
  background: #f3f4f6;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  overflow: hidden;
  pointer-events: none;
}
.board-thumbnail svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.board-open strong {
  display: block;
  font-size: 14px;
  margin: 12px 0 6px;
  overflow-wrap: anywhere;
}
.board-open > span {
  font-size: 12px;
  color: #7a8190;
}
.saved-board-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 8px;
}
.saved-board-footer time {
  font-size: 11px;
  color: #858c98;
  flex: 1;
}
.storage-note {
  font-size: 12px !important;
  margin-bottom: 0 !important;
}
.storage-error {
  background: #fff1e7;
  padding: 12px;
  border-radius: 6px;
  color: #8e5428 !important;
}
@media (max-width: 640px) {
  .saved-boards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .boards-dialog {
    padding: 24px 18px;
  }
  .board-thumbnail {
    height: 95px;
  }
}
@media (max-width: 520px) {
  .boards-launcher {
    padding: 9px 5px;
    font-size: 11px;
    gap: 5px;
  }
  .boards-launcher svg {
    width: 14px;
  }
  .saved-board-footer time {
    font-size: 10px;
  }
  .saved-board-footer {
    padding: 0 8px 8px;
  }
}
@media (max-width: 360px) {
  .saved-boards {
    grid-template-columns: 1fr;
  }
}
/* 12. Controles de imágenes dentro de figuras. */
.image-add {
  width: 100%;
  white-space: normal;
}
.image-name {
  overflow-wrap: anywhere;
}
.property-section:has(#shape-image) {
  background: #faf8fd;
}
.property-section:has(#shape-image) .field-row {
  gap: 8px;
}
.property-section:has(#shape-image) .full-label {
  line-height: 1.5;
}
#objects image {
  pointer-events: none;
}
.board-thumbnail image {
  pointer-events: none;
}
@media (max-width: 520px) {
  .library .image-add {
    font-size: 11px;
    padding: 8px 5px;
  }
}
/* 13. Adaptación general: escritorio amplio, compacto, tableta y teléfono. */
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 270px minmax(200px, 1fr) 286px;
  }
  .library-section {
    padding-left: 24px;
    padding-right: 24px;
  }
  .shape-palette button {
    height: 88px;
  }
  .panel-heading {
    padding-left: 24px;
  }
  .topbar {
    height: 88px;
  }
  .workspace {
    height: calc(100dvh - 88px);
  }
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: 210px minmax(200px, 1fr) 230px;
  }
  .brand-sub,
  .brand-divider {
    display: none;
  }
  .topbar {
    gap: 20px;
    padding: 0 20px;
  }
  .project-name {
    padding-left: 20px;
  }
  .canvas-hint {
    display: none;
  }
  .library-section,
  .property-section {
    padding-left: 15px;
    padding-right: 15px;
  }
  .grid-card {
    gap: 7px;
  }
  .grid-card b {
    font-size: 10px;
  }
  .small-badge {
    display: none;
  }
  .inspector-tabs {
    gap: 20px;
    padding-left: 15px;
  }
  .header-actions {
    gap: 8px;
  }
  .library-bottom {
    padding: 20px 15px;
  }
}
@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 165px minmax(240px, 1fr);
    grid-template-rows: minmax(420px, 1fr) auto;
    height: calc(100dvh - 72px);
    min-height: 700px;
  }
  .topbar {
    height: 72px;
    padding: 0 15px;
    gap: 15px;
  }
  .brand {
    font-size: 23px;
  }
  .project-name {
    border: 0;
    padding: 0;
  }
  .project-name input {
    font-size: 12px;
  }
  .project-name > span {
    font-size: 9px;
  }
  .header-actions .button {
    padding: 9px;
    font-size: 11px;
  }
  .header-actions > .icon-button {
    display: none;
  }
  .inspector {
    grid-column: 1/-1;
    max-height: 300px;
    border-top: 1px solid var(--line);
    overflow: auto;
  }
  .inspector-bottom {
    display: none;
  }
  #properties-panel {
    display: flex;
    flex-wrap: wrap;
  }
  .property-section {
    flex: 1;
    min-width: 190px;
  }
  .library-bottom {
    display: none;
  }
  .shape-palette button {
    font-size: 10px;
  }
  .grid-card {
    flex-wrap: wrap;
  }
  .grid-card small {
    font-size: 9px;
  }
  .game-palette {
    gap: 4px;
  }
  .game-palette button {
    font-size: 10px;
  }
  .colors {
    gap: 6px;
  }
  .swatch {
    width: 20px;
    height: 20px;
  }
  .panel-heading {
    padding: 22px 15px;
  }
  .panel-heading h1 {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .left-tabs {
    padding: 0 15px;
    gap: 20px;
  }
  .left-tabs button {
    font-size: 11px;
  }
  .library-section {
    padding-top: 18px;
  }
  .library-section h2 {
    font-size: 9px;
  }
  .canvas-toolbar {
    padding: 0 8px;
  }
  .toolbar-group {
    gap: 2px;
  }
  .canvas-caption {
    left: 15px;
  }
  .statusbar {
    padding: 0 10px;
  }
  .statusbar #mode-status {
    display: none;
  }
  .inspector-tabs {
    height: 45px;
    padding-top: 0;
  }
  .inspector-tabs button {
    padding: 12px 0;
  }
  .header-actions .button span[data-icon] {
    display: none;
  }
}
@media (max-width: 520px) {
  .project-name {
    display: none;
  }
  .header-actions {
    margin-left: auto;
  }
  .workspace {
    grid-template-columns: 112px minmax(200px, 1fr);
  }
  .panel-heading {
    padding: 18px 10px;
  }
  .panel-heading h1 {
    font-size: 11px;
  }
  .eyebrow {
    display: none;
  }
  .library-section {
    padding: 17px 8px 0;
  }
  .shape-palette {
    gap: 5px;
  }
  .shape-palette button {
    height: 66px;
    font-size: 9px;
  }
  .left-tabs {
    gap: 12px;
    padding: 0 8px;
  }
  .left-tabs button {
    font-size: 10px;
  }
  .game-palette {
    grid-template-columns: 1fr;
  }
  .game-palette button {
    height: 40px;
    flex-direction: row;
    gap: 12px;
  }
  .token-preview {
    width: 22px;
    height: 22px;
  }
  .card-preview {
    height: 25px;
    width: 19px;
  }
  .grid-card {
    padding: 8px;
  }
  .grid-card > span:nth-child(2) {
    display: none;
  }
  .colors {
    flex-wrap: wrap;
  }
  .library-section .small {
    font-size: 9px;
  }
  .canvas-toolbar {
    height: 50px;
  }
  .toolbar-group .separator {
    margin: 0 2px;
  }
  .icon-button {
    width: 27px;
    height: 29px;
  }
  .toggle-label {
    font-size: 9px;
    gap: 3px;
  }
  .canvas-caption {
    font-size: 8px;
    gap: 7px;
  }
  #board-size {
    display: none;
  }
  .zoom-controls {
    right: 12px;
  }
  .statusbar {
    font-size: 8px;
  }
  .template {
    padding: 6px;
  }
  .template-art {
    padding: 12px;
    font-size: 16px;
  }
}
/* 14. Ajustes finales de teléfono; complementan el bloque anterior de 520 px. */
@media (max-width: 520px) {
  .library {
    overflow-x: hidden;
  }
  .shape-palette {
    grid-template-columns: minmax(0, 1fr);
  }
  .shape-palette button {
    flex-direction: row;
    height: 44px;
    gap: 6px;
    min-width: 0;
    font-size: 10px;
  }
  .shape-palette svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  .left-tabs {
    flex-direction: column;
    gap: 0;
    padding: 0 10px;
  }
  .left-tabs button {
    padding: 8px;
    font-size: 12px;
  }
  .property-section {
    min-width: 100%;
    padding: 20px;
  }
  .inspector-tabs {
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
  }
  .field {
    font-size: 14px;
  }
  .game-palette button {
    font-size: 11px;
  }
  .property-note {
    font-size: 14px;
  }
}
