/* The tier list maker on top of /matches/rift.css: same tokens, sharp
   corners, one border, no halos. Rows like tiermaker (coloured label, cards,
   gear and arrows), in the Rift Record look. */

:root { --th: 112px; --tw: 80px; --lw: 104px; }
@media (max-width: 699px) { :root { --th: 84px; --tw: 60px; --lw: 62px; } }

.tl-app, .tl-landing { min-height: 60vh; padding-bottom: 40px; }
.tl-hero { padding-top: calc(var(--nav) + 34px); padding-bottom: 18px; }
.tl-eye { font: 700 14px/1 var(--f-read); color: var(--gold); margin-bottom: 10px; }
.tl-title { font: 700 clamp(38px, 6.4vw, 64px)/.98 var(--f-title); color: var(--ink); text-shadow: 0 2px 18px rgba(2,5,11,.6); overflow-wrap: anywhere; }
.tl-lede { margin-top: 14px; max-width: 680px; font: 600 16px/1.55 var(--f-read); color: var(--ink2); }
.tl-doors { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-top: 24px; }
.hextech.lg .hx-in { font: 700 20px/1 var(--f-title); padding: 0 26px; }
.tl-other { margin: 0 0 12px; padding: 10px 14px; font: 600 14px/1.45 var(--f-read); color: var(--ink2); box-shadow: inset 2px 0 0 var(--arcane); background: rgba(10,200,185,.06); }

/* ------------------------------------------------------------------ bar */
.tl-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 22px; flex-wrap: wrap; padding: 6px 0 14px; }
.bar-l, .bar-r { display: flex; align-items: center; gap: 4px 22px; flex-wrap: wrap; }
.word:disabled { opacity: .35; cursor: default; }
.save { font: 700 13px/1 var(--f-read); color: var(--mute); }

/* ---------------------------------------------------------------- board */
.tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; background: rgba(200,170,110,.22); padding: 1px; }
.row { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr) auto; min-height: calc(var(--th) + 8px); background: #071022; }
.label { display: grid; place-items: center; padding: 6px; background: var(--c); color: #02050B; font: 700 30px/1 var(--f-title); text-align: center; overflow-wrap: anywhere; cursor: pointer; }
.label span { padding-top: 4px; }
.label:has(span:empty)::after { content: ""; }
.cards { list-style: none; margin: 0; padding: 4px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; min-width: 0; }
.ctl { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 6px; border-left: 1px solid var(--hair); }
.ctl button { display: grid; place-items: center; width: 30px; height: 28px; color: var(--control); }
.ctl button:hover:not(:disabled) { color: var(--gold-light); }
.ctl button:disabled { opacity: .25; cursor: default; }
.ctl svg { width: 17px; height: 17px; }
@media (max-width: 699px) {
  .label { font-size: 22px; padding: 4px; }
  .ctl { padding: 2px; } .ctl button { width: 26px; height: 26px; } .ctl svg { width: 15px; height: 15px; }
}

/* ---------------------------------------------------------------- tiles */
.tcard { position: relative; flex: none; width: var(--tw); height: var(--th); cursor: grab; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tcard.bf { width: calc(var(--th) * 1.395); }
.tcard img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; background: #0b1424; -webkit-user-drag: none; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.tcard:hover img { box-shadow: 0 0 0 1.5px var(--gold-light); }
.tcard.sel img { box-shadow: 0 0 0 2px var(--gold-light), 0 0 0 4px rgba(2,5,11,.9); }
.tcard.sel { transform: translateY(-3px); }
.tcard.lifting { opacity: .28; }
.tcard.noimg img { opacity: 0; }
.tcard.noimg b { position: absolute; inset: 0; display: grid; place-items: center; padding: 4px; text-align: center; font: 700 11px/1.15 var(--f-read); color: var(--ink2); background: #16233b; border-radius: 4px; }
.tcard.ghost { position: fixed; z-index: 90; left: 0; top: 0; pointer-events: none; opacity: .95; filter: drop-shadow(0 14px 22px rgba(0,0,0,.7)); }
html.dragging, html.dragging * { cursor: grabbing !important; }
html.dragging body { -webkit-user-select: none; user-select: none; }

/* ----------------------------------------------------------------- pool */
.pool-head { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin: 30px 0 12px; }
.pool-head h2 { font: 700 24px/1 var(--f-title); color: var(--ink); padding-top: 3px; }
.pool-n { font: 700 13px/1 var(--f-read); color: var(--mute); }
.pool-q { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 38px; min-width: min(100%, 240px); border-bottom: 1px solid var(--hair); color: var(--mute); }
.pool-q svg { width: 16px; height: 16px; flex: none; }
.pool-q input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ink); font: 600 15px/1 var(--f-read); }
.pool-q:focus-within { border-color: rgba(200,170,110,.45); }
.pool { list-style: none; margin: 0; padding: 8px; min-height: calc(var(--th) + 16px); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px;
  background: rgba(2,5,11,.5); box-shadow: inset 0 0 0 1px rgba(200,170,110,.22); }
.pool-empty { display: flex; align-items: center; gap: 16px; padding: 10px 6px; font: 700 14px/1.3 var(--f-read); color: var(--mute); }

/* tap to place */
.hint-bar { position: fixed; z-index: 60; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 18px;
  width: max-content; max-width: calc(100vw - 24px); padding: 6px 18px; background: #0c1a33; box-shadow: inset 0 0 0 1px rgba(200,170,110,.5), 0 16px 40px -10px #000; font: 700 14px/1.3 var(--f-read); }
.hint-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint-bar b { color: var(--gold-light); }
.hint-bar .word { color: var(--gold-light); }

/* ---------------------------------------------------------------- sheets */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.sw { width: 38px; height: 38px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
.sw.on { box-shadow: 0 0 0 2px var(--ground-deep), 0 0 0 4px var(--gold-light); }
.row-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: 18px; }
.row-acts .word:disabled { opacity: .3; }
.rift-dialog.wide { width: min(1240px, calc(100vw - 24px)); }
.rift-dialog.wide #sheet-body { display: flex; flex-direction: column; height: calc(100vh - 32px); overflow: hidden; padding-bottom: 0; }
.add-top { display: flex; align-items: center; gap: 8px 22px; padding: 0 24px 12px; flex: none; }
.add-q { flex: 1; min-width: 0; margin: 0; }
.add-top .word:disabled { opacity: .35; cursor: default; }
#add-ftoggle { display: none; }
.add-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); border-top: 1px solid var(--hair); }
.add-filter { min-height: 0; overflow: auto; padding: 4px 20px 24px 24px; border-right: 1px solid var(--hair); scrollbar-width: thin; }
.add-results { min-height: 0; overflow: auto; padding: 0 24px 20px; }
.add-filter h3 { margin: 18px 0 8px; font: 800 13px/1 var(--f-read); color: var(--mute); }
.f-hint { margin-top: 14px; font: 600 12.5px/1.45 var(--f-read); color: var(--dim); }
.fcs { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--hair); background: rgba(240,230,210,.03); color: var(--control); font: 700 13.5px/1 var(--f-read); }
@media (hover: hover) { .fchip:hover { border-color: rgba(200,170,110,.5); color: var(--ink); } }
.fchip i { font-style: normal; color: var(--mute); font-size: 12px; }
.fchip.in { border-color: rgba(200,170,110,.85); background: rgba(200,170,110,.12); color: var(--gold-light); }
.fchip.out { border-color: var(--lost); text-decoration: line-through; color: var(--mute); }
.fchip[style*="--kc"] { border-left: 3px solid var(--kc); }
.fchip.link { border-color: transparent; color: var(--gold); }
.fchip .dot, .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.fchip .dot + .dot { margin-left: -3px; }
.fchip .gem { flex: none; }
.rng-group { margin: 18px 0 4px; }
.rng-head { display: flex; align-items: baseline; gap: 10px; } .rng-head h3 { margin: 0; flex: 1; }
.rng-head b { font: 800 13px/1 var(--f-read); color: var(--mute); font-variant-numeric: tabular-nums; } .rng-head b.on { color: var(--gold-light); }
.rng-x { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(240,230,210,.25); font-size: 13px; }
.rng { position: relative; height: 28px; margin: 6px 9px 0; }
.rng::before, .rng::after { content: ""; position: absolute; top: 50%; height: 4px; transform: translateY(-50%); }
.rng::before { left: 0; right: 0; background: rgba(240,230,210,.12); }
.rng::after { left: var(--a); right: calc(100% - var(--b)); background: var(--gold); }
.rng input { position: absolute; inset: 0 -9px; width: calc(100% + 18px); margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; z-index: 1; }
.rng input::-webkit-slider-runnable-track { background: none; height: 28px; }
.rng input::-moz-range-track { background: none; }
.rng input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 5px; border-radius: 50%; background: var(--gold-light); border: 2px solid var(--gold); cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,.6); }
.rng input::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--gold-light); border: 2px solid var(--gold); cursor: grab; }
.rng-ticks { display: flex; justify-content: space-between; margin: 2px 0 0; padding: 0 9px; font: 700 11px/1 var(--f-read); color: var(--dim); font-variant-numeric: tabular-nums; }
.rng-ticks span { width: 0; display: flex; justify-content: center; white-space: nowrap; }
.add-sum { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; background: linear-gradient(180deg, #0b1830 70%, rgba(11,24,48,0)); font: 700 13px/1 var(--f-read); color: var(--mute); }
.add-sum .word:disabled { opacity: .35; cursor: default; }
.add-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px 10px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.atile button { position: relative; display: block; width: 100%; }
.atile img { width: 100%; aspect-ratio: 744 / 1039; object-fit: cover; border-radius: 4px; background: #0b1424; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.atile.bf img { aspect-ratio: 1039 / 744; }
.atile b { display: block; margin-top: 5px; font: 700 12.5px/1.2 var(--f-read); color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atile:hover img { box-shadow: 0 0 0 1.5px var(--gold-light); }
.atile.in img { box-shadow: 0 0 0 2px var(--gold); }
.atile.in .tick { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%2302050B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.add-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--hair); font: 700 14px/1 var(--f-read); color: var(--mute); }
@media (max-width: 899px) {
  #add-ftoggle { display: inline-flex; }
  .add-split { display: block; overflow: auto; }
  .add-filter { display: none; border-right: 0; border-bottom: 1px solid var(--hair); padding: 0 16px 18px; overflow: visible; }
  .f-open .add-filter { display: block; }
  .add-results { overflow: visible; padding: 0 16px 16px; }
}
@media (max-width: 699px) {
  .rift-dialog.wide { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .rift-dialog.wide #sheet-body { height: 100dvh; max-height: 100dvh; }
  .add-top { padding: 0 16px 12px; gap: 8px 16px; }
  .add-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px 8px; }
  .add-foot { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
  .row-acts { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------- around the maker */
.tl-text { margin-top: 44px; }
.tl-text p { max-width: 900px; margin-bottom: 10px; font: 600 14.5px/1.6 var(--f-read); color: var(--ink2); }
.tl-text p b { display: inline-block; min-width: 34px; margin-right: 8px; color: var(--gold-light); }
.tl-text .names { color: var(--mute); }
.tl-templates { margin-top: 48px; }
.tg { margin-bottom: 22px; }
.tg h3 { margin-bottom: 10px; font: 700 15px/1 var(--f-read); color: var(--gold); }
.tg ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.tg a { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 50px; padding: 0 14px 0 16px;
  background: linear-gradient(180deg, rgba(12,26,51,.72), rgba(5,12,24,.72)); box-shadow: inset 0 0 0 1px rgba(200,170,110,.22); transition: box-shadow .12s; }
.tg a:hover, .tg a[aria-current] { box-shadow: inset 0 0 0 1px rgba(200,170,110,.65); }
.tg a b { font: 700 19px/1 var(--f-title); color: var(--ink); padding-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg a .num { font-size: 15px; color: var(--mute); }
.peek { list-style: none; margin: 34px 0 0; padding: 0; display: flex; gap: 6px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
.peek .tcard { cursor: default; }
.tl-mine { margin-top: 30px; }
.mine-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.mine-list a { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: linear-gradient(180deg, rgba(12,26,51,.72), rgba(5,12,24,.72)); box-shadow: inset 0 0 0 1px rgba(200,170,110,.3); }
.mine-list a:hover { box-shadow: inset 0 0 0 1px rgba(200,170,110,.7); }
.mine-list b { font: 700 21px/1.05 var(--f-title); color: var(--ink); padding-top: 3px; }
.mine-list span { font: 700 13px/1 var(--f-read); color: var(--mute); }
.tl-how, .tl-faq { margin-top: 48px; }
.steps { margin: 0; padding: 0 0 0 22px; display: grid; gap: 12px; max-width: 760px; font: 600 15px/1.55 var(--f-read); color: var(--ink2); }
.steps b { color: var(--ink); }
.tl-faq details { max-width: 760px; border-bottom: 1px solid var(--hair); }
.tl-faq summary { padding: 16px 0; cursor: pointer; font: 800 16px/1.3 var(--f-read); color: var(--ink); }
.tl-faq details p { padding-bottom: 16px; font: 600 15px/1.55 var(--f-read); color: var(--ink2); }
.tl-plate { margin-top: 56px; }
.plate-in { display: flex; align-items: center; justify-content: space-between; gap: 22px 34px; flex-wrap: wrap; padding: 24px 26px;
  background: linear-gradient(180deg, rgba(12,26,51,.85), rgba(5,12,24,.85)); box-shadow: inset 0 0 0 1px rgba(200,170,110,.45); }
.plate-in > div:first-child { max-width: 600px; }
.plate-in h2 { font: 700 30px/1.02 var(--f-title); color: var(--ink); }
.plate-in p:not(.tl-eye) { margin-top: 10px; font: 600 15px/1.55 var(--f-read); color: var(--ink2); }
.stores { display: flex; gap: 12px; flex-wrap: wrap; }
.tl-foot { margin-top: 56px; padding: 28px 0 40px; border-top: 1px solid var(--hair); }
.tl-foot p { max-width: 820px; margin-bottom: 8px; font: 600 13px/1.55 var(--f-read); color: var(--mute); }
.tl-foot .links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; }
.tl-foot .links a { color: var(--control); }
.tl-foot .links a:hover { color: var(--ink); }
.topnav .tabs a { font-size: 20px; }
@media (max-width: 699px) { .topnav .tabs a { font-size: 18px; } }
@media (max-width: 520px) { .topnav .get-app { display: none; } .topnav .tabs { gap: 16px; } }

/* ------------------------------------------- desktop: the cards beside the rows */
@media (min-width: 1100px) {
  .tl-app .wrap { max-width: 1720px; }
  .tl-work { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 540px); grid-template-areas: "bar bar" "other other" "board pool"; column-gap: 28px; align-items: start; }
  .tl-bar { grid-area: bar; }
  .tl-other { grid-area: other; }
  .tiers { grid-area: board; }
  .tl-pool { grid-area: pool; position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
  .tl-pool .pool-head { margin: 0 0 10px; flex: none; }
  .tl-pool .pool-q { min-width: 0; flex: 1 1 160px; }
  .tl-pool .pool { flex: 1 1 auto; min-height: calc(var(--th) + 16px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(200,170,110,.4) transparent; }
}
