:root{color-scheme:dark;font-family:Arial,Helvetica,sans-serif;background:#191919;color:#eee;--tools-height:64px;--tile:calc(36px * var(--board-zoom,1));--tile-height:calc(100px / 3 * var(--board-zoom,1));--letter:80px}
*{box-sizing:border-box}
body{margin:0}
button,input,select{font:inherit}
button,input,select{outline-offset:3px}
:focus-visible{outline:2px solid #fff}
.tools{position:sticky;top:0;z-index:20;min-height:64px;padding:10px 14px;display:flex;gap:12px;align-items:center;background:#141414;border-bottom:3px solid #090909}
#add{display:flex;gap:7px;flex:1;min-width:0;max-width:790px}
input,select{height:40px;min-width:0;border:1px solid #3d3d3d;border-radius:5px;background:#232323;color:#f7f7f7;padding:0 12px}
input::placeholder{color:#999}
#name{flex:1.2;width:180px}
#image{flex:1;width:160px}
select{width:58px;padding:0 8px;cursor:pointer}
#add-button{width:40px;flex-shrink:0;height:40px;border:0;border-radius:5px;background:#ededed;color:#161616;font-size:29px;line-height:1;cursor:pointer}
#add-button:hover{background:#fff}
#add-button:disabled{opacity:.4;cursor:wait}
.search-wrap{position:relative;flex:.55;max-width:300px;min-width:120px;margin-left:auto}
#search{width:100%}
.connection{width:6px;height:6px;flex-shrink:0;border-radius:50%;background:#777}
.connection.live{background:#8edc9d}
.connection.offline{background:#f7b26b}
.connection.local{background:#999}
#results{position:absolute;right:0;top:46px;width:min(330px,calc(100vw - 28px));max-height:60vh;overflow:auto;background:#242424;border:1px solid #505050;border-radius:5px;box-shadow:0 10px 30px #0008}
.result{display:flex;align-items:center;gap:12px;width:100%;background:none;border:0;color:#eee;text-align:left;padding:12px;cursor:pointer;border-bottom:1px solid #383838;overflow-wrap:anywhere}
.result:hover,.result.active{background:#383838}
.result b{display:grid;place-items:center;width:27px;height:27px;color:#111;border-radius:2px;flex-shrink:0}
.no-results{padding:14px;color:#aaa;font-size:14px}
.row{display:flex;min-height:calc(116px * var(--board-zoom,1));border-bottom:calc(4px * var(--board-zoom,1)) solid #090909;background:#1c1c1b;position:relative;scroll-margin-top:calc(var(--tools-height) + 8px)}
.letter{position:relative;flex:0 0 var(--letter);display:flex;align-items:center;justify-content:center;color:#080808;font-size:49px;font-weight:800;border-right:4px solid #090909;user-select:none}
.items{display:grid;flex:1;grid-template-rows:repeat(3,var(--tile-height));grid-template-columns:repeat(var(--space-cols,1),var(--tile));grid-auto-columns:var(--tile);grid-auto-flow:column;gap:calc(2px * var(--board-zoom,1));align-content:start;justify-content:start;padding:calc(4px * var(--board-zoom,1));min-width:0;height:calc(112px * var(--board-zoom,1));overflow-x:auto;overflow-y:hidden;overflow-anchor:none;scrollbar-width:none;transition:background .1s}
.items::-webkit-scrollbar{display:none}
.row.over .items{background:#ffffff10;outline:2px solid #ffffff70;outline-offset:-3px}
.card{width:var(--tile);height:var(--tile-height);position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:2px;background:#30302f;border:0;border-radius:2px;color:#f5f5f5;font-size:calc(8px * var(--board-zoom,1));font-weight:600;line-height:1.15;text-align:center;overflow-wrap:anywhere;cursor:grab;user-select:none;touch-action:none;overflow:hidden;flex-shrink:0}
.card:hover{background:#3c3c3a}
.card.has-image{padding:0;background:#f4f4f4;color:#111}
.card img{display:block;width:100%;height:calc(var(--tile-height) - 8px * var(--board-zoom,1));object-fit:contain;background:#f4f4f4;pointer-events:none}
.card.has-image .item-name{display:block;width:100%;height:calc(8px * var(--board-zoom,1));line-height:calc(8px * var(--board-zoom,1));padding:0 1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:calc(6px * var(--board-zoom,1));font-weight:600}
.card.image-failed{padding:2px;background:#30302f;color:#f5f5f5}
.card.image-failed .item-name{height:auto;line-height:1.25;white-space:normal;font-size:calc(8px * var(--board-zoom,1))}
.card.drag-source{opacity:.18}
.ghost{position:fixed;z-index:100;pointer-events:none;opacity:.9;box-shadow:0 8px 24px #0008;transform:rotate(3deg);cursor:grabbing}
.drop-mark{width:var(--tile);height:var(--tile-height);background:#ffffff20;border:1px dashed #eee;border-radius:2px;pointer-events:none}
.flash{animation:flash 1.7s ease-out}
@keyframes flash{0%,25%{box-shadow:inset 0 0 0 1px #fff;background:#68684b}100%{box-shadow:inset 0 0 0 0 #fff0}}
#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:12px 18px;background:#ededed;color:#171717;font-size:14px;border-radius:6px;box-shadow:0 5px 25px #0006;z-index:200;text-align:center}
body.dragging{cursor:grabbing}
@media(max-width:650px){:root{--tile:calc(88px / 3 * var(--board-zoom,1));--tile-height:calc(28px * var(--board-zoom,1));--letter:58px}.tools{padding:8px;gap:7px;flex-wrap:wrap}#add{flex-basis:100%;max-width:none}#name{width:105px}#image{width:120px}input{font-size:14px;padding:0 9px}.search-wrap{max-width:none;flex:1}.connection{margin:0 5px}.row{min-height:calc(100px * var(--board-zoom,1))}.items{height:calc(96px * var(--board-zoom,1))}.letter{font-size:39px}.card{font-size:calc(7px * var(--board-zoom,1))}.card img{height:calc(var(--tile-height) - 7px * var(--board-zoom,1))}.card.has-image .item-name{height:calc(7px * var(--board-zoom,1));line-height:calc(7px * var(--board-zoom,1))}.card.image-failed .item-name{font-size:calc(7px * var(--board-zoom,1))}}
@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition:none!important}}

.card > .item-name{max-width:100%;max-height:100%;overflow:hidden}
.image-credit{position:absolute;top:1px;left:1px;right:1px;z-index:1;padding:1px;background:#111d;color:#fff;font-size:7px;font-weight:400;line-height:1.1;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;visibility:hidden;pointer-events:none;cursor:pointer}
.card:hover .image-credit,.card:focus-within .image-credit{visibility:visible;pointer-events:auto}
.image-credit:hover,.image-credit:focus-visible{white-space:normal;background:#111;max-height:calc(var(--tile-height) - 2px);overflow-y:auto}

.zoom-controls{display:flex;flex-shrink:0;height:40px;border:1px solid #3d3d3d;border-radius:5px;overflow:hidden}
.zoom-controls button{border:0;background:#232323;color:#eee;min-width:30px;padding:0 7px;cursor:pointer}
.zoom-controls button:hover{background:#353535}.zoom-controls button:disabled{opacity:.35;cursor:default}
#zoom-reset{min-width:48px;font-size:12px}
body.modal-open{overflow:hidden}
#viewer{width:min(700px,calc(100vw - 24px));max-height:calc(100dvh - 24px);margin:auto;padding:20px;border:1px solid #555;border-radius:8px;background:#202020;color:#eee;overflow:auto}
#viewer::backdrop{background:#000b;backdrop-filter:blur(2px)}
.viewer-heading{display:flex;align-items:flex-start;gap:16px;margin-bottom:14px}
#viewer-title{font-size:23px;line-height:1.25;overflow-wrap:anywhere;margin:0;flex:1;white-space:pre-wrap}
#viewer-close{border:0;background:none;color:#ddd;font-size:27px;line-height:1;padding:0 3px;cursor:pointer}
#viewer-image{width:100%;max-height:48vh;object-fit:contain;background:#141414;display:block;border-radius:3px}
#viewer-image[hidden]{display:none}
#viewer-credits{font-size:12px;line-height:1.5;color:#bbb;margin:10px 0 18px;overflow-wrap:anywhere}
#viewer-credits a{color:#d6e6ff;text-decoration:underline}
.comments-heading{display:flex;align-items:center;gap:12px;margin-top:14px}
.comments h3{font-size:15px;font-weight:600;margin:0 0 8px;flex:1}
#comments-earlier{border:0;background:none;color:#bbb;font-size:12px;text-decoration:underline;cursor:pointer}
#comment-list{max-height:250px;overflow:auto;overflow-wrap:anywhere}
.comment{padding:10px 0;border-top:1px solid #393939}
.comment p{margin:0 0 5px;font-size:14px;line-height:1.45;white-space:pre-wrap}
.comment time{font-size:11px;color:#999}
#comment-status{font-size:12px;color:#bbb;margin:7px 0;min-height:16px}
#comment-form{display:flex;align-items:flex-end;gap:8px}
#comment-text{font:inherit;min-width:0;flex:1;resize:vertical;min-height:54px;max-height:180px;padding:9px;border:1px solid #505050;border-radius:4px;background:#161616;color:#eee;font-size:14px}
#comment-post{height:38px;border:0;border-radius:4px;background:#eee;color:#111;padding:0 14px;cursor:pointer}
#comment-post:disabled{opacity:.4;cursor:wait}
@media(max-width:650px){.zoom-controls button{min-width:25px;padding:0 5px}#zoom-reset{min-width:42px}#viewer{padding:15px}#viewer-title{font-size:20px}}

#board{overflow-anchor:none}

body[data-site-game="everything-tier-list"] .tools{top:var(--site-game-bar-height);}
body[data-site-game="everything-tier-list"] .row{scroll-margin-top:calc(var(--tools-height) + var(--site-game-bar-height) + 8px);}
