/* Home and article entrances to the bookmark inventory. */
.ec-icon {
  display: inline-block !important;
  flex: none;
  object-fit: contain;
  image-rendering: pixelated;
  vertical-align: middle;
  max-width: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
.site-header:has(.ec-shortcut) { gap: clamp(.55rem, 2vw, 1.7rem); }
.site-header:has(.ec-shortcut) > nav { margin-left: auto; }
.ec-shortcut, .ec-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  box-sizing: border-box;
  padding: .42rem .78rem;
  border: 2px solid #20352f;
  border-radius: 0;
  background: #304842;
  box-shadow: inset 0 2px #76927e, inset 0 -3px #162b26;
  color: #f6f3df;
  font: 700 .94rem/1.4 system-ui, sans-serif;
  cursor: pointer;
}
.ec-shortcut { flex: none; padding: .17rem .72rem .17rem .4rem; }
.ec-shortcut .ec-icon { filter: drop-shadow(1px 2px #101c1a); }
.ec-station .ec-icon { position: relative; z-index: 1; filter: drop-shadow(3px 5px #17211c55); }
.ec-station .station-ground {
  width: min(75%, 125px);
  background: #253731 url('/base-camp/textures/obsidian.png') center / 32px 32px;
  border-bottom-color: #26352f;
  outline: 2px solid #4d6a61;
  image-rendering: pixelated;
}
.ec-station .station-scene::after {
  content: ''; position: absolute; left: 28%; top: 28%; width: 3px; height: 3px;
  background: #9563ae; box-shadow: 7px -6px #bf93d4, 52px 12px #9a75b2, 60px 5px #c59bd6;
  pointer-events: none;
}
.ec-dock, .ec-gallery-actions, .ec-shelf-entry { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.ec-button.ec-secondary { background: #e1e6dd; border-color: #61756a; color: #26372f; box-shadow: inset 0 2px #fbfff6, inset 0 -3px #a8b2a9; }
.ec-button.ec-save[aria-pressed=true] { color: #e4e0fa; background: #37384e; box-shadow: inset 0 2px #827a9d, inset 0 -3px #222235; }
.ec-button:hover, .ec-shortcut:hover { filter: brightness(1.09); }
.ec-dock button:focus-visible, .ec-shortcut:focus-visible, .ec-station:focus-visible, .ec-shelf-entry button:focus-visible, .ec-gallery-actions button:focus-visible { outline: 3px solid #c18df4; outline-offset: 3px; }
.ec-dock .ec-status:not(.ec-error), #ender-chest .ec-status:not(.ec-error) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.ec-dock .ec-error { flex-basis: 100%; }

/* The case uses the chest palette. The item tray follows Bedrock's recessed slots. */
#ender-chest {
  --ec-columns: 9;
  --ec-light: #f4f4ef; --ec-shadow: #707477; --ec-text: #202623;
  box-sizing: border-box; position: fixed; inset: 0; margin: auto; padding: 0;
  width: min(38rem, calc(100% - 1rem)); max-width: none;
  max-height: calc(100vh - 1.3rem); max-height: calc(100dvh - 1.3rem);
  overflow: auto; overscroll-behavior: contain; color-scheme: light;
  border: 3px solid #121a19; border-radius: 0;
  background: #c6c8c5; color: var(--ec-text);
  box-shadow: 0 0 0 1px #94a398, 4px 6px 0 #0e1419b3, 0 18px 60px #090c15a6;
  text-align: left; font: 400 1rem/1.55 system-ui, sans-serif; letter-spacing: normal;
}
#ender-chest:not([open]), #ender-chest [hidden] { display: none !important; }
#ender-chest::backdrop { background: #0c1019bb; }
#ender-chest button, #ender-chest a { box-sizing: border-box; border-radius: 0; font: 700 .94rem/1.45 system-ui, sans-serif; }
#ender-chest button { cursor: pointer; }
#ender-chest button:disabled { cursor: default; }
#ender-chest .ec-lid {
  position: sticky; top: 0; z-index: 2;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(.6rem, 2vw, 1.1rem);
  padding: .5rem clamp(.75rem, 3vw, 1.3rem) .55rem;
  border: 2px solid; border-color: #759684 #182a25 #101f1d #4f796b;
  border-bottom-width: 4px;
  background-color: #203532;
  background-image: linear-gradient(90deg, #224039ce, #203630ee 65%, #263336d6), url('/base-camp/textures/obsidian.png');
  background-size: auto, 48px 48px;
}
#ender-chest .ec-lid::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; width: 22px; height: 5px; transform: translateX(-50%);
  background: #b9974e; border-top: 2px solid #f1d995; border-inline: 2px solid #554628; z-index: 1;
}
#ender-chest .ec-lid-emblem {
  width: 66px; height: 70px; display: grid; align-items: end; justify-items: center;
  position: relative; isolation: isolate;
}
#ender-chest .ec-lid-emblem::before {
  content: ''; position: absolute; inset: 18% 7% 0; z-index: -1;
  background: radial-gradient(ellipse, #a886be6b 0, #8b75a333 45%, transparent 73%);
}
#ender-chest .ec-lid-emblem img { width: 55px; height: auto; filter: drop-shadow(2px 3px 0 #0b1413); }
#ender-chest .ec-lid-title p { margin: 0 0 .12rem; color: #c9dcca; font: 650 .875rem/1.45 system-ui, sans-serif; }
#ender-chest h2, #ender-chest h3 { margin: 0; padding: 0; border: 0; }
#ender-chest h2::before, #ender-chest h2::after, #ender-chest h3::before, #ender-chest h3::after { content: none !important; }
#ender-chest #ec-title { background: transparent; color: #f4f4e7; font: 800 clamp(1.2rem, 4.6vw, 1.65rem)/1.28 system-ui, sans-serif; letter-spacing: .035em; text-shadow: 2px 2px #131d17; }
#ender-chest .ec-close, #ender-chest .ec-view, #ender-chest .ec-pages button, #ender-chest [data-ec-remove], #ender-chest .ec-read {
  min-height: 44px; border: 2px solid; border-color: #f6f6ee #676d69 #5b625e #eceee8; border-radius: 0;
  color: #252a26; background: #d2d4ce; box-shadow: 0 0 0 1px #565d58;
  padding: .4rem .75rem; text-decoration: none;
}
#ender-chest .ec-close {
  display: grid; place-items: center; width: 44px; padding: 0;
  background: #41564e; border-color: #93aa93 #23372f #1b2825 #7a9687;
  color: #f0f1dc; box-shadow: 0 0 0 1px #0d2119; font: 700 1.6rem/1 system-ui, sans-serif;
}
#ender-chest .ec-tray {
  padding: .7rem clamp(.7rem, 3vw, 1.25rem) .7rem;
  border: 3px solid; border-color: #ecede9 #858a85 #767d78 #e1e4dc;
  background: #c8cac6;
}
#ender-chest .ec-tray-head { display: flex; flex-wrap: wrap; align-items: center; gap: .42rem; min-height: 44px; margin-bottom: .42rem; }
#ender-chest #ec-books-title { font: 750 1.06rem/1.4 system-ui, sans-serif; color: #28302b; background: none; }
#ender-chest .ec-count { font: 650 .9rem/1.4 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: #424d43; }
#ender-chest .ec-view { margin-left: auto; padding-inline: .6rem; font-size: .875rem; }
#ender-chest .ec-storage {
  display: grid; grid-template-columns: repeat(var(--ec-columns), minmax(0,1fr)); gap: 1px;
  border: 2px solid; border-color: #646966 #eaede6 #eaede6 #646966; padding: 2px;
  background: #b4b7b1;
}
#ender-chest .ec-slot {
  display: grid; place-items: center; box-sizing: border-box; position: relative;
  min-width: 0; min-height: 0; width: 100%; aspect-ratio: 1; margin: 0; padding: 0; border-radius: 0;
  border: 2px solid; border-color: #5b605e #e9eae6 #e4e7de #606562;
  background: #929693; box-shadow: none;
}
#ender-chest .ec-book { touch-action: manipulation; }
#ender-chest .ec-cover {
  display: block; flex: none; aspect-ratio: 1; image-rendering: pixelated;
  background-image: url("/base-camp/textures/book-covers.png"); background-repeat: no-repeat;
  background-position: var(--ec-x, 0%) var(--ec-y, 0%);
}
#ender-chest .ec-book .ec-cover { width: min(86%, 48px); filter: drop-shadow(1px 2px #423d396b); }
#ender-chest [data-view=slots] .ec-slot span { display: none; }
#ender-chest .ec-book[aria-selected=true] {
  border-color: #f4fff0 #f4fff0 #f4fff0 #f4fff0; background: #668767; box-shadow: inset 0 0 0 2px #375039;
}
#ender-chest .ec-book:hover { background-color: #b5bcb2; }
#ender-chest .ec-book[aria-selected=true]:hover { background-color: #749473; }
#ender-chest .ec-storage[data-view=names] { grid-template-columns: minmax(0,1fr); max-height: min(38dvh, 19rem); overflow-y: auto; overscroll-behavior: contain; }
#ender-chest [data-view=names] .ec-book {
  display: flex; align-items: center; gap: .65rem; aspect-ratio: auto; min-height: 48px;
  padding: .35rem .65rem; background-color: #b1b7af; color: #1d261f; text-align: left;
}
#ender-chest [data-view=names] .ec-book[aria-selected=true] { background-color: #bbd0b5; }
#ender-chest [data-view=names] .ec-book span { overflow-wrap: anywhere; white-space: normal; }
#ender-chest [data-view=names] .ec-cover { width: 32px; }
#ender-chest .ec-pages { display: flex; align-items: center; justify-content: center; gap: .9rem; margin-top: .65rem; color: #303b32; font-weight: 700; }
#ender-chest .ec-pages button:disabled { color: #666d66; background: #c0c3be; border-color: #cdd0c9 #9a9e98 #9a9e98 #cdd0c9; box-shadow: none; }
#ender-chest .ec-pages span { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }
#ender-chest .ec-empty, #ender-chest .ec-detail {
  margin-top: .9rem; padding: .75rem .85rem;
  border: 2px solid; border-color: #777187 #f5f2f8 #f5f2f8 #777187; background: #e0dfe4;
  color: #292a2c;
}
#ender-chest .ec-empty strong, #ender-chest .ec-book-info strong { font: 750 1rem/1.5 system-ui, sans-serif; color: #282c28; }
#ender-chest .ec-empty p { margin: .24rem 0 0; font: 400 1rem/1.55 system-ui, sans-serif; color: #434447; }
#ender-chest .ec-detail { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: .55rem .74rem; align-items: center; }
#ender-chest .ec-detail-book {
  display: grid; place-items: center; width: 42px; height: 46px;
  background: #3b3747; border: 2px solid; border-color: #675c71 #211f2b #211f2b #574e63; box-sizing: border-box;
}
#ender-chest .ec-book-info { min-width: 0; }
#ender-chest .ec-detail-book .ec-cover { width: 38px; }
#ender-chest .ec-book-info span { display: block; color: #54535d; font: 650 .8125rem/1.45 system-ui, sans-serif; }
#ender-chest .ec-book-info strong { display: block; overflow-wrap: anywhere; }
#ender-chest .ec-item-actions { grid-column: 1/-1; display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; padding-top: .1rem; }
#ender-chest .ec-read {
  display: inline-flex; align-items: center; justify-content: center;
  background: #375c36; color: #fffcef !important; border-color: #8cae79 #253f25 #1b321f #709b67; box-shadow: 0 0 0 1px #31452d;
}
#ender-chest .ec-item-actions button { font-size: .875rem; }
#ender-chest .ec-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .15rem .6rem; margin-top: .32rem; }
#ender-chest .ec-foot a { display: inline-flex; align-items: center; min-height: 44px; color: #26492e !important; text-decoration: underline; text-underline-offset: .2em; }
#ender-chest .ec-foot small { font: 500 .8125rem/1.4 system-ui, sans-serif; color: #424b44; }
#ender-chest .ec-error { margin: .4rem 0 0; font-size: .94rem; color: #673526; }
#ender-chest :is(button,a):focus-visible { outline: 3px solid #593580; outline-offset: 2px; z-index: 1; }
#ender-chest .ec-slot:focus-visible { outline-offset: -4px; }
#ender-chest .ec-close:focus-visible { outline-color: #e2b3fa; }
@media(max-width: 760px) {
  .site-header:has(.ec-shortcut) { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'brand chest' 'nav nav'; gap: .4rem .45rem; }
  .site-header:has(.ec-shortcut) > .brand { grid-area: brand; width: fit-content; }
  .site-header:has(.ec-shortcut) > .ec-shortcut { grid-area: chest; }
  .site-header:has(.ec-shortcut) > nav { grid-area: nav; margin: .4rem 0 0; }
}
@media(max-width: 590px) {
  #ender-chest { --ec-columns: 6; }
}
@media(max-width: 365px) {
  #ender-chest { --ec-columns: 5; }
  #ender-chest #ec-title { font-size: clamp(1rem, 5.5vw, 1.2rem); letter-spacing: normal; }
  #ender-chest .ec-lid { gap: .45rem; padding-inline: .55rem; }
  #ender-chest .ec-lid-emblem { width: 48px; height: 58px; }
  #ender-chest .ec-lid-emblem img { width: 45px; }
  #ender-chest .ec-tray { padding-inline: .55rem; }
  .ec-shortcut { padding-inline: .25rem .5rem; gap: .22rem; font-size: .875rem; }
  .ec-shortcut .ec-icon { width: 30px; height: 30px; }
  .ec-dock .ec-button { padding-inline: .5rem; font-size: .875rem; }
}
@media(forced-colors: active) {
  #ender-chest .ec-slot { border: 1px solid ButtonText; }
  #ender-chest .ec-book[aria-selected=true] { outline: 3px solid Highlight; outline-offset: -4px; }
}

#ender-chest .ec-cover{background-size:800% 900%}
#ender-chest [data-cover-x="0"]{--ec-x:0%}
#ender-chest [data-cover-x="1"]{--ec-x:14.285714285714286%}
#ender-chest [data-cover-x="2"]{--ec-x:28.571428571428573%}
#ender-chest [data-cover-x="3"]{--ec-x:42.857142857142854%}
#ender-chest [data-cover-x="4"]{--ec-x:57.142857142857146%}
#ender-chest [data-cover-x="5"]{--ec-x:71.42857142857143%}
#ender-chest [data-cover-x="6"]{--ec-x:85.71428571428571%}
#ender-chest [data-cover-x="7"]{--ec-x:100%}
#ender-chest [data-cover-y="0"]{--ec-y:0%}
#ender-chest [data-cover-y="1"]{--ec-y:12.5%}
#ender-chest [data-cover-y="2"]{--ec-y:25%}
#ender-chest [data-cover-y="3"]{--ec-y:37.5%}
#ender-chest [data-cover-y="4"]{--ec-y:50%}
#ender-chest [data-cover-y="5"]{--ec-y:62.5%}
#ender-chest [data-cover-y="6"]{--ec-y:75%}
#ender-chest [data-cover-y="7"]{--ec-y:87.5%}
#ender-chest [data-cover-y="8"]{--ec-y:100%}
