/* The tier list site, in the classic tier list layout: a dark page, pastel label cells on the left, dark rows of
   square pictures, a black control column on the right (⚙ and arrows), and the pool of unranked pictures below.
   Plain sans-serif, square edges, nothing loaded from elsewhere. */
:root {
  --page: #1A1A17; --row: #1A1A17; --edge: #000000; --panel: #242421; --text: #DDDDDD; --muted: #A7A7A2; --bright: #FFFFFF;
  --link: #6AB4F5; --blue: #2196F3; --focus: #6AB4F5;
  --sans: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* our display rules mustn't show hidden things (the empty search results) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { background: var(--page); }
body { margin: 0; color: var(--text); font: 16px/1.5 var(--sans); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* who you are, in a black bar */
.corner { background: #000000; display: flex; gap: 18px; justify-content: flex-end; align-items: center; padding: 12px 24px; font-size: 15px; }
.corner a, .corner button.link { color: var(--bright); }
.corner form { margin: 0; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 16px 64px; display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
h1 { margin: 0; font: bold 34px/1.2 var(--sans); color: var(--bright); }
h2 { margin: 0; font: bold 15px/1.3 var(--sans); color: var(--bright); }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.back { font-size: 14px; }
.intro { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding-top: 8vh; }
.intro p { margin: 0; color: var(--muted); }
.note { background: var(--panel); border-left: 3px solid var(--blue); padding: 6px 12px; margin: 0; }

.button, button { font: 15px var(--sans); min-height: 38px; padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  color: var(--bright); text-decoration: none; background: #000000; border: 1px solid #555555; }
.button:hover, button:hover:not(:disabled) { background: #2A2A27; text-decoration: none; }
.button.primary, button.primary { background: var(--blue); border-color: var(--blue); }
.button.primary:hover, button.primary:hover:not(:disabled) { background: #1A7FD0; }
button.danger { color: #FF8A80; }
button.link { border: 0; background: none; padding: 0; min-height: 0; }
button:disabled { opacity: 0.4; cursor: default; }

.lists { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; border: 1px solid #333330; }
.lists li { padding: 12px 14px; border-top: 1px solid #333330; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.lists li:first-child { border-top: 0; }
.lists .big { font-size: 18px; font-weight: bold; }
.lists .sub { margin: 0; font-size: 14px; }
.new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input, select { font: 15px var(--sans); min-height: 38px; padding: 0 10px; color: var(--bright); background: #000000; border: 1px solid #555555; }

/* the tier list */
.board { display: flex; flex-direction: column; background: var(--edge); border: 1px solid var(--edge); gap: 2px; }
.tier { display: flex; flex-wrap: wrap; min-height: 150px; position: relative; background: var(--row); }
.label { flex: 0 0 140px; margin: 0; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center;
  padding: 8px 6px; font: 22px/1.2 var(--sans); color: #000000; word-break: break-word; }
.t0 { background: #FF7F7F; } .t1 { background: #FFBF7F; } .t2 { background: #FFDF7F; } .t3 { background: #FFFF7F; }
.t4 { background: #BFFF7F; } .t5 { background: #7FFF7F; } .t6 { background: #7FFFFF; } .t7 { background: #7FBFFF; }
.sets { flex: 999 1 480px; min-width: 0; list-style: none; margin: 0; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.sets .empty { display: none; }
.tile { width: 128px; padding: 0; display: flex; flex-direction: column; gap: 4px; position: relative; }
.pic { width: 128px; height: 100px; object-fit: contain; background: #FFFFFF; display: block; }
.tile .name { font-size: 12px; line-height: 1.25; color: var(--text); text-align: left; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pic-none { display: flex; align-items: center; justify-content: center; background: #333330; color: var(--muted); font: 10px var(--mono); }
.pool { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pool .sets { min-height: 150px; border: 1px solid #333330; }

/* the editor */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .grow { flex-grow: 1; }
.title-input { font: bold 34px/1.2 var(--sans); color: var(--bright); background: transparent; border: 0; border-bottom: 1px dashed transparent;
  padding: 0; min-height: 0; max-width: 100%; }
.title-input:hover, .title-input:focus { border-bottom-color: #555555; }
.label { cursor: grab; }
.label input { width: 100%; text-align: center; font: inherit; color: #000000; background: transparent; border: 0; padding: 0; min-height: 0; }
.label input:hover, .label input:focus { background: rgba(255, 255, 255, 0.45); }
.label .stars { font-size: 13px; letter-spacing: 1px; color: rgba(0, 0, 0, 0.7); }
.controls { flex: 0 0 76px; display: flex; align-items: center; justify-content: center; gap: 4px; background: #000000; }
.gear { min-height: 44px; width: 38px; padding: 0; justify-content: center; font-size: 30px; line-height: 1; border: 0; background: transparent; color: var(--bright); }
.gear:hover:not(:disabled), .gear[aria-expanded="true"] { background: transparent; color: var(--link); }
.arrows { display: flex; flex-direction: column; }
.arrow { min-height: 32px; width: 30px; padding: 0; justify-content: center; border: 0; background: transparent; color: var(--bright); }
.arrow:hover:not(:disabled) { background: transparent; color: var(--link); }
.settings { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--panel); font-size: 14px; }
.settings .grow { flex-grow: 1; }
.editing .tile { cursor: grab; border: 0; background: none; min-height: 0; font: inherit; color: var(--text); align-items: stretch; }
.editing .tile:hover:not(:disabled) { background: none; }
.editing .tile:hover .pic { outline: 2px solid var(--link); outline-offset: -2px; }
.editing .tile.picked .pic { outline: 3px solid #FFD54F; outline-offset: -3px; }
.editing .sets.target { outline: 2px dashed #777770; outline-offset: -3px; cursor: pointer; }
.search { position: relative; }
.search input { min-width: 260px; }
.results { position: absolute; z-index: 5; top: 42px; left: 0; width: 340px; background: #000000; border: 1px solid #555555; padding: 0; list-style: none; margin: 0; }
.results li + li { border-top: 1px solid #333330; }
.results button { width: 100%; justify-content: space-between; border: 0; text-align: left; }
.results .meta { font: 12px var(--mono); color: var(--muted); }
.error { color: #FF8A80; }

@media (max-width: 640px) {
  .label { flex-basis: 90px; font-size: 17px; }
  .controls { flex-basis: 100%; justify-content: flex-end; padding: 2px 8px; }
  .arrows { flex-direction: row; }
  .tile, .pic { width: calc(33.3vw - 40px); }
  .pic { height: auto; aspect-ratio: 4 / 3; }
  .search input { min-width: 0; width: 100%; }
  .results { width: 100%; }
}
