@font-face{font-family:Fredoka;src:url('assets/fonts/fredoka.woff2');font-weight:400 700;font-display:swap}
@font-face{font-family:Nunito;src:url('assets/fonts/nunito.woff2');font-weight:400 900;font-display:swap}
:root{--ink:#12265e;--muted:#47557a;--purple:#6532ec;--purple-dark:#4320b4;--paper:#ffd21c;--line:#12265e;--period:#006584;--period-light:#00cee2;--display:Fredoka,'Arial Rounded MT Bold','Trebuchet MS',sans-serif;--body:Nunito,'Trebuchet MS',sans-serif}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;color:var(--ink);background:var(--paper);font-family:var(--body);font-size:15px;line-height:1.35;-webkit-tap-highlight-color:transparent}
button,input,output{font:inherit}
button,a,input,label{touch-action:manipulation}
button{cursor:pointer;color:inherit;border:0}
button:disabled{cursor:default;opacity:.35}
a{color:inherit;text-decoration:none}
button,input,a{outline-offset:3px}
button:focus-visible,input:focus-visible,a:focus-visible{outline:3px solid #ff7400}
button svg,a svg{pointer-events:none}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.icon{display:inline-block;width:22px;height:22px;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;border-radius:10px;background:white;padding:8px 12px;font-weight:900;line-height:1.2;border:2px solid var(--line);transition:background .15s,transform .15s}
.button:hover:not(:disabled){background:#ffe000}
.button:active:not(:disabled){transform:translateY(1px)}
.button-primary{background:var(--purple);color:white;border-color:#301378}
.button-primary:hover:not(:disabled){background:var(--purple-dark)}
.icon-button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;min-width:34px;border-radius:8px;background:transparent}
.icon-button:hover:not(:disabled){background:#ffe000;color:var(--ink)}
.skip-link{position:fixed;top:-70px;left:12px;padding:10px;background:var(--ink);color:white;z-index:100}
.skip-link:focus{top:8px}
.site-header{background:#1747d1;border-bottom:3px solid var(--line)}
.header-inner{max-width:1440px;padding:12px 24px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand h1{font:600 32px/1.1 var(--display);letter-spacing:-.4px;color:#ffe000;margin:0}
.collection-button{background:#ffe000;font-size:12px;white-space:nowrap}
.collection-button.selected{background:#ff7600}
.collection-button .icon{width:20px;height:20px}
.collection-count{background:white;border-radius:6px;min-width:22px;padding:3px 5px;font-size:10px}
.gallery-view{max-width:1440px;margin:auto;padding:18px 24px 24px}
.gallery-controls{display:flex;align-items:center;gap:16px;margin-bottom:16px;min-width:0}
.period-tabs{display:flex;flex:1;min-width:0;gap:8px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding:3px 2px 10px;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#173378 transparent;overscroll-behavior-x:contain;user-select:none}
.period-tab{display:flex;align-items:center;justify-content:center;flex:0 0 auto;gap:6px;min-height:43px;padding:8px 12px;border-radius:12px;background:var(--tab-light);border:2px solid var(--line);box-shadow:0 3px 0 var(--line);color:var(--ink);font:500 17px/1.1 var(--display);white-space:nowrap;scroll-snap-align:start}
.period-tab[data-period="neogeno"],.period-tab[data-period="cuaternario"]{color:white}
.period-tab .icon{width:21px;height:21px}
.period-symbol{display:flex;align-items:center;justify-content:center;width:22px;height:22px}
.period-choice{display:none;place-items:center;width:22px;height:22px;border-radius:50%;background:#ffe000;color:var(--ink)}
.period-tab .period-choice .icon{width:15px;height:15px;stroke-width:3}
.period-tab[aria-selected=true]{background:#12265e;color:white;border-color:#12265e;font-weight:600;box-shadow:0 4px 0 #12265e}
.period-tab[aria-selected=true] .period-symbol{display:none}
.period-tab[aria-selected=true] .period-choice{display:grid}
.period-tab:hover{filter:brightness(1.06)}
.search-box{display:flex;align-items:center;gap:8px;flex:0 0 205px;border:2px solid var(--line);background:white;border-radius:11px;padding:9px 11px;min-width:0;margin-bottom:7px}
.search-box .icon{width:18px;height:18px}
.search-box input{border:0;background:none;outline:none;width:100%;min-width:0;color:var(--ink);font-size:12px;font-weight:800}
.search-box input::placeholder{color:var(--muted)}
.search-box:focus-within{box-shadow:0 0 0 3px #ff7600}
.species-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.species-card{position:relative;background:white;border:2px solid var(--line);border-radius:15px;padding:9px;box-shadow:0 4px 0 var(--card-color);display:flex;flex-direction:column;min-width:0;text-align:left;transition:transform .15s}
.species-card:hover{transform:translateY(-3px)}
.card-preview{display:block;aspect-ratio:4/3;background:white;border-radius:8px;overflow:hidden}
.card-preview img{display:block;width:100%;height:100%;object-fit:contain}
.card-number{position:absolute;left:12px;top:12px;z-index:1;font-size:9px;font-weight:900;border-radius:6px;padding:2px 5px;background:#ffe000;color:var(--ink);border:1px solid var(--line)}
.card-painted{position:absolute;right:12px;top:12px;z-index:1;width:24px;height:24px;display:grid;place-items:center;background:#00d780;color:#123b35;border:2px solid #143e34;border-radius:50%}
.card-painted .icon{width:13px;height:13px}
.card-detail{padding:8px 3px 3px;min-height:32px;display:flex;align-items:center}
.card-detail strong{font-size:13px;font-weight:900;line-height:1.2;display:block;overflow-wrap:anywhere}
.era-group+.era-group{margin-top:24px}
.era-group-title{display:flex;align-items:center;gap:7px;font:500 22px var(--display);margin:0 0 12px;color:var(--group-color)}
.empty-state{text-align:center;background:white;padding:35px 16px;border:2px solid var(--line);border-radius:16px}
.empty-state h3{font:500 23px var(--display);margin:0 0 16px}
.editor-open{background:#181b20;color:#edf1f8;color-scheme:dark;overflow:hidden}
.editor-open .site-header{display:none}
.editor-view{height:100dvh;max-width:1920px;margin:auto;padding:8px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:8px}
.editor-heading{display:flex;align-items:center;gap:10px;min-width:0}
.back-button{width:38px;min-width:38px;padding:0;align-self:center;background:#ffe000;color:var(--ink)}
.back-button .icon{width:20px;height:20px}
.drawing-heading{flex:1;min-width:0}
.drawing-heading h1{font:500 19px/1.15 var(--display);margin:0;color:white;overflow-wrap:anywhere}
.editor-period{color:#ffe000;font-size:10px;font-weight:900}
.editor-controls{display:flex;align-items:center;gap:5px;padding:3px 5px;background:#262b34;border:2px solid #414956;border-radius:12px}
.history-actions,.zoom-controls{display:flex;align-items:center;gap:1px}
.history-actions{padding-right:5px;border-right:1px solid #4a5260}
.history-actions .icon,.zoom-controls .icon{width:19px;height:19px}
.zoom-controls>span{font-size:10px;font-weight:900;min-width:36px;text-align:center}
.fit-button{margin-left:3px}
.save-status{display:grid;place-items:center;min-width:24px;color:#4ae4aa}
.save-status .icon{width:18px;height:18px}
.save-status.warning{color:#ffa56f}
.export-actions{display:flex;align-items:center;gap:5px}
.export-actions>.icon-button{color:white}
.export-actions>.button{font-size:12px;min-height:38px;padding:8px 12px}
.export-actions .icon{width:20px;height:20px}
.workbench{min-height:0;display:grid;grid-template-columns:64px minmax(0,1fr) 204px;gap:8px;align-items:stretch}
.tool-dock{align-self:start;background:#262b34;border:2px solid #414956;border-radius:13px;display:flex;flex-direction:column;padding:4px;gap:3px}
.tool-button{width:52px;min-height:54px;border-radius:9px;background:transparent;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;font-size:8px;font-weight:900;user-select:none}
.tool-button .icon{width:24px;height:24px}
.tool-button:hover{background:#3c4452}
.tool-button.active{background:#ffd000;color:var(--ink);box-shadow:inset 0 0 0 2px var(--ink)}
.dock-divider{height:1px;background:#4a5260;margin:3px 5px}
.reset-button{color:#ffac80}
.drawing-area{min-width:0;min-height:0;display:flex;overflow:hidden;border:1px solid #414956;border-radius:10px;background:#30343b}
.viewport{flex:1;min-width:0;min-height:0;height:100%;overflow:hidden;position:relative;background:#30343b;touch-action:none;cursor:crosshair;isolation:isolate}
.paper{position:absolute;left:50%;top:50%;background:white;box-shadow:0 3px 15px #0007;transform-origin:center;will-change:transform}
.paper canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;user-select:none;-webkit-user-select:none}
.paper canvas:not(:first-child){pointer-events:none}
#ink-canvas{mix-blend-mode:multiply}
.brush-cursor{position:absolute;pointer-events:none;border:1px solid #222;box-shadow:0 0 0 1px #ffffffaa;border-radius:50%;transform:translate(-50%,-50%);z-index:3}
.loading-sheet{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;background:#30343b;z-index:4;color:white;font-size:13px}
.loading-pencils{display:flex;gap:8px;align-items:flex-end;height:44px}
.loading-pencils i{width:12px;height:34px;border-radius:4px;background:#ff2d55;animation:pencils .7s ease-in-out infinite alternate}
.loading-pencils i:nth-child(2){background:#ffe000;animation-delay:.15s}
.loading-pencils i:nth-child(3){background:#00dfb0;animation-delay:.3s}
@keyframes pencils{to{transform:translateY(-10px) rotate(6deg)}}
.color-panel{align-self:start;max-height:100%;overflow-y:auto;background:#262b34;border:2px solid #414956;border-radius:13px;padding:10px;scrollbar-width:thin}
.palette-options{display:flex;align-items:center;gap:6px;margin-bottom:10px}
.palette-tabs{display:flex;flex:1;min-width:0;gap:2px;padding:2px;background:#15191f;border-radius:8px}
.palette-tabs button{flex:1;background:transparent;color:white;min-height:28px;border-radius:6px;padding:3px 4px;font-size:10px;font-weight:900}
.palette-tabs button.active{background:#ffe000;color:var(--ink)}
.custom-color{display:block;cursor:pointer;width:100%;max-width:34px;justify-self:center}
.custom-color-preview{display:grid;place-items:center;background:#ff2d55;width:100%;aspect-ratio:1;min-height:28px;border-radius:7px;border:1px solid #748094;position:relative;color:white}
.custom-color-preview .icon{width:18px;height:18px;stroke-width:2.5}
.custom-color input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer;padding:0;border:0}
.custom-color-preview:focus-within{outline:3px solid #ff7400;outline-offset:2px}
.color-swatches{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.color-swatch{width:100%;aspect-ratio:1;max-width:34px;min-height:0;border-radius:7px;background:var(--swatch);border:1px solid #748094;position:relative;justify-self:center;display:grid;place-items:center}
.color-swatch:hover{box-shadow:inset 0 0 0 2px #fff8}
.color-swatch.selected{outline:2px solid #ffd000;outline-offset:1px;box-shadow:inset 0 0 0 2px white}
.color-swatch .icon{width:18px;height:18px;stroke-width:3;color:var(--check-color,white)}
.my-colors{border-top:1px solid #4a5260;margin-top:10px;padding-top:7px}
.my-colors h2{font-size:11px;font-weight:900;margin:0 0 6px;color:#edf1f8}
.my-colors-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;max-height:114px;overflow:auto;padding:2px;scrollbar-width:thin}
#my-color-swatches{display:contents}
.species-link{background:#ffd000;color:var(--ink);border-color:#ffd000;white-space:nowrap}
.species-link:hover{background:#ffe85b}
.editor-open .friendly-dialog{background:#262b34;border-color:#778499;color:#edf1f8;box-shadow:4px 6px 0 #0008}
.editor-open .friendly-dialog .button:not(.button-primary){background:#3c4452;border-color:#778499;color:#edf1f8}
.brush-settings{display:grid;gap:6px;border-top:1px solid #4a5260;margin-top:10px;padding-top:8px}
.range-label{display:flex;align-items:center;justify-content:space-between;font-size:10px;font-weight:900}
.range-label output{font-size:10px}
.brush-settings input[type=range]{display:block;width:100%;height:18px;margin:1px 0;accent-color:#ffd000;cursor:pointer}
.clip-toggle{display:flex;align-items:center;gap:6px;font-size:9px;font-weight:900;cursor:pointer}
.clip-toggle input{position:absolute;opacity:0;width:30px;height:20px;margin:0}
.toggle-track{display:block;width:30px;height:18px;min-width:30px;border-radius:12px;background:#6a7491;padding:3px}
.toggle-track:after{content:'';display:block;width:12px;height:12px;background:white;border-radius:50%;transition:transform .15s}
.clip-toggle input:checked+.toggle-track{background:var(--purple)}
.clip-toggle input:checked+.toggle-track:after{transform:translateX(12px)}
.clip-toggle input:focus-visible+.toggle-track{outline:3px solid #ff7400;outline-offset:2px}
.drawing-carousel{display:flex;gap:7px;overflow-x:auto;overflow-y:hidden;min-width:0;padding:2px 2px 7px;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#ffe000 transparent;overscroll-behavior-x:contain;user-select:none}
.carousel-card{position:relative;display:flex;flex-direction:column;flex:0 0 108px;width:108px;gap:2px;min-width:0;overflow:hidden;background:#262b34;border:2px solid #414956;border-radius:9px;padding:3px;scroll-snap-align:start;text-align:center}
.carousel-card img{display:block;background:white;border-radius:4px;width:100%;height:61px;object-fit:contain;pointer-events:none}
.carousel-card span{font-size:9px;font-weight:900;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.carousel-card[aria-current=true]{border-color:#ffe000;background:#ffe000;color:var(--ink);box-shadow:0 0 0 1px #ffe000}
.carousel-card:hover{border-color:#ff7600}
.period-tabs.dragging,.drawing-carousel.dragging{scroll-snap-type:none;cursor:grabbing}
.dragging button{cursor:grabbing}
.friendly-dialog{padding:24px;border:3px solid var(--line);border-radius:18px;max-width:380px;width:calc(100% - 28px);color:var(--ink);background:#ffd000;box-shadow:4px 6px 0 #07112b;text-align:center}
.friendly-dialog::backdrop{background:#111a3ca6}
.friendly-dialog h2{font:500 27px/1.2 var(--display);margin:0 0 10px}
.friendly-dialog p{font-size:12px;margin:0}
.dialog-actions{display:flex;justify-content:center;gap:10px;margin-top:20px}
.dialog-actions .button{flex:1;font-size:12px}
.toast{position:fixed;bottom:18px;left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;background:#12265e;color:white;border:2px solid #ffd000;padding:9px 14px;border-radius:12px;font-size:12px;font-weight:800;z-index:50;max-width:calc(100% - 24px);text-align:center}
.toast.visible{opacity:1;transform:translate(-50%,0)}
.noscript-message{padding:24px;background:white;text-align:center}
@media(max-width:1100px){
  .gallery-controls{display:block}
  .search-box{width:100%;max-width:300px;margin:6px 0 0 auto}
  .period-tabs{margin-bottom:6px}
  .species-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .drawing-heading h1{font-size:17px}
  .editor-heading{gap:7px}
  .export-actions>.button{width:36px;padding:6px}
  .export-actions>.button span:last-child{display:none}
  .export-actions>.species-link{width:auto;padding:7px 10px}
  .export-actions>.species-link span:last-child{display:inline}
}
@media(max-width:760px){
  .header-inner{padding:10px 12px}
  .brand{gap:6px}
  .brand h1{font-size:25px}
  .collection-button{min-height:35px;padding:6px 8px;font-size:10px}
  .collection-button>span:nth-child(2){display:none}
  .collection-count{min-width:19px;font-size:9px;padding:2px 4px}
  .gallery-view{padding:12px}
  .gallery-controls{display:flex;flex-direction:column;align-items:stretch;gap:7px;margin-bottom:12px}
  .period-tabs{flex:auto;margin:0;padding-bottom:9px;gap:7px}
  .period-tab{font-size:16px;min-height:42px;padding:7px 10px;gap:5px}
  .period-tab .icon{width:19px;height:19px}
  .search-box{flex:0 0 auto;max-width:none;width:100%;min-height:38px;margin:0;padding:8px 10px}
  .species-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 10px}
  .species-card{padding:6px;border-radius:12px;box-shadow:0 3px 0 var(--card-color)}
  .card-detail{padding:7px 2px 2px;min-height:31px}
  .card-detail strong{font-size:11px}
  .card-number{left:9px;top:9px;font-size:8px;padding:1px 4px}
  .card-painted{right:9px;top:9px;width:20px;height:20px}
  .editor-view{padding:6px;gap:6px}
  .editor-heading{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:5px 7px}
  .back-button{width:34px;min-width:34px;min-height:34px}
  .drawing-heading h1{font-size:16px}
  .editor-period{font-size:9px}
  .editor-controls{grid-column:1/-1;grid-row:2;justify-content:center;padding:1px 4px;gap:12px;border-radius:10px}
  .editor-controls .icon-button{width:30px;height:30px;min-width:30px}
  .editor-controls .icon{width:18px;height:18px}
  .history-actions{padding-right:12px}
  .export-actions{grid-column:3;grid-row:1;gap:2px}
  .export-actions>.icon-button{width:30px;height:30px;min-width:30px}
  .export-actions>.button{min-height:34px;width:34px;padding:6px}
  .export-actions>.species-link{width:auto;padding:6px 8px;font-size:10px;gap:4px}
  .export-actions>.species-link .icon{width:17px;height:17px}
  .workbench{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto auto;gap:6px}
  .drawing-area{grid-row:1;min-height:120px}
  .tool-dock{grid-row:2;flex-direction:row;justify-content:space-between;align-items:center;padding:3px;gap:2px;border-radius:10px}
  .tool-button{flex:1;width:auto;min-width:0;min-height:43px;font-size:8px;gap:2px;border-radius:7px}
  .tool-button .icon{width:22px;height:22px}
  .dock-divider{width:1px;height:25px;margin:0 3px}
  .color-panel{grid-row:3;max-height:none;overflow:visible;padding:6px;border-radius:10px}
  .palette-options{margin-bottom:6px;gap:7px}
  .palette-tabs{max-width:245px;padding:2px}
  .palette-tabs button{min-height:25px;font-size:10px}
  .my-colors{margin-top:6px;padding-top:5px}
  .my-colors h2{font-size:10px;margin-bottom:4px}
  .my-colors-grid{grid-template-columns:repeat(10,minmax(0,1fr));gap:4px;max-height:76px}
  .custom-color{max-width:none}
  .custom-color-preview{width:100%;min-height:0}
  .color-swatches{grid-template-columns:repeat(10,minmax(0,1fr));gap:4px}
  .color-swatch{max-width:none;border-radius:6px}
  .color-swatch .icon{width:16px;height:16px}
  .brush-settings{grid-template-columns:1fr 1fr;gap:4px 14px;margin-top:6px;padding-top:5px}
  .clip-toggle{grid-column:1/-1;min-height:21px}
  .drawing-carousel{gap:6px;padding-bottom:5px}
  .carousel-card{flex-basis:90px;width:90px;padding:2px;border-radius:7px}
  .carousel-card img{height:49px}
  .carousel-card span{font-size:8px}
}
@media(max-width:380px){
  .brand h1{font-size:22px}
  .header-inner{gap:5px}
  .collection-button{gap:4px;padding:5px}
  .gallery-view{padding:10px}
  .drawing-heading h1{font-size:14px}
  .editor-controls{gap:8px}
  .color-swatches{gap:3px}
}
@media(max-width:760px) and (max-height:680px){
  .editor-open{overflow:auto}
  .editor-view{height:auto;min-height:100dvh;grid-template-rows:auto auto auto}
  .workbench{grid-template-rows:200px auto auto}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
@media print{body>*{display:none!important}}
