/* Martinez Access crypto tier list.
   Dark by default to match the site. The board comes first. Unranked coins
   live in a tray that never pushes the tiers out of view: a sticky column
   beside the board on wide screens, and a bounded tray docked to the bottom
   of the screen everywhere else. */

:root {
    color-scheme: dark;
    --bg: #11171d;
    --panel: #161f28;
    --row: #172029;
    --raised: #23313d;
    --raised-hover: #2b3b48;
    --field: #0f151b;
    --popover: #1a242e;
    --tray-bg: rgba(22, 31, 40, 0.94);
    --toast: #22303c;
    --hover: rgba(121, 189, 198, 0.08);
    --accent-bg: #214d57;
    --line: #27333d;
    --btn-ring: #3a4b58;
    --field-ring: #2e3c48;
    --ink: #d3dde4;
    --ink-strong: #e6ecef;
    --ink-soft: #b4c1ca;
    --muted: #9aaab7;
    --cyan: #79bdc6;
    --primary: #285b65;
    --primary-hover: #2f6c78;
    --primary-ink: #eaf5f6;
    --danger-ink: #f0aaa2;
    --logo-bg: #0c1217;
    --tier-ink: #13202a;
    --tier-s: #72c99d;
    --tier-a: #a9cf82;
    --tier-b: #dccb8b;
    --tier-c: #e0ad80;
    --tier-d: #df8f86;
    --tier-f: #94a3ae;
    --display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --ease: cubic-bezier(0.2, 0.65, 0.2, 1);
    --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.75);
}

body.light-mode {
    color-scheme: light;
    --bg: #e9eef2;
    --panel: #f3f6f8;
    --row: #f6f8fa;
    --raised: #dde4ea;
    --raised-hover: #d2dbe2;
    --field: #ffffff;
    --popover: #fbfcfd;
    --tray-bg: rgba(243, 246, 248, 0.95);
    --toast: #ffffff;
    --hover: rgba(40, 91, 101, 0.07);
    --accent-bg: #cfe5e8;
    --line: #d5dde3;
    --btn-ring: #c3ced6;
    --field-ring: #c9d3db;
    --ink: #2b3946;
    --ink-strong: #15202a;
    --ink-soft: #3d4c59;
    --muted: #5b6b78;
    --cyan: #1f6f7b;
    --danger-ink: #a3362d;
    --logo-bg: #e3e9ee;
    --shadow-pop: 0 24px 60px -24px rgba(20, 35, 48, 0.35);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol {
    margin: 0;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

::selection {
    background: #294953;
    color: #e1e8ed;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 200;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--primary);
    color: var(--primary-ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.page {
    width: min(2120px, calc(100% - 64px));
    margin: 0 auto;
}

/* ---------- Site navigation (mirrors the Next.js site header) ---------- */

.site-nav {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    border-bottom: 1px solid var(--line);
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
    white-space: nowrap;
    text-decoration: none;
    color: var(--ink);
}

.brand-monogram {
    font-weight: 800;
    letter-spacing: -0.09em;
    font-size: 30px;
    line-height: 1;
}

.brand-monogram > span {
    color: var(--cyan);
}

.brand-subtitle {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 12px;
    font-weight: 500;
}

.nav-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current] {
    color: var(--cyan);
}

.nav-links .nav-contact {
    min-height: 0;
    padding: 10px 17px;
    border-radius: 6px;
    background: var(--raised);
    color: var(--ink);
}

.nav-links .nav-contact:hover {
    background: var(--raised-hover);
    color: var(--ink);
}

/* ---------- Page header ---------- */

.tl-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 40px;
    padding: 32px 0 22px;
}

.tl-header h1 {
    font-family: var(--display);
    font-weight: 450;
    font-size: clamp(40px, 4.2vw, 56px);
    line-height: 1.02;
    letter-spacing: -0.022em;
    color: var(--ink-strong);
}

.lede {
    margin-top: 12px;
    max-width: 48em;
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.tl-prefs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 6px 14px 6px 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--btn-ring);
    cursor: pointer;
}

.switch:hover {
    background: var(--hover);
}

.switch-track {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 10px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--btn-ring);
    transition: background 0.2s;
}

.switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 0.2s var(--ease), background 0.2s;
}

.switch[aria-pressed="true"] .switch-track {
    background: var(--primary);
}

.switch[aria-pressed="true"] .switch-thumb {
    transform: translateX(14px);
    background: var(--primary-ink);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--raised);
    color: var(--ink-strong);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--btn-ring);
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:hover {
    background: var(--raised-hover);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-ink);
    box-shadow: inset 0 0 0 1px rgba(160, 220, 228, 0.28);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-sm {
    min-height: 34px;
    padding: 7px 13px;
    font-size: 12.5px;
}

.btn-danger {
    color: var(--danger-ink);
}

.btn:disabled {
    cursor: default;
    opacity: 0.75;
}

.btn.is-loading {
    pointer-events: none;
}

.btn.is-success {
    pointer-events: none;
    background: #2d6a4f;
    color: #eaf7ef;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-check {
    display: inline-block;
    width: 14px;
    height: 14px;
}

.btn-check svg {
    display: block;
    width: 14px;
    height: 14px;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--btn-ring);
    transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
    background: var(--hover);
    color: var(--ink-strong);
}

.icon-btn-sm {
    width: 32px;
    height: 32px;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#moreBtn svg circle {
    fill: currentColor;
    stroke: none;
}

#themeToggle .icon-moon {
    display: none;
}

body.light-mode #themeToggle .icon-sun {
    display: none;
}

body.light-mode #themeToggle .icon-moon {
    display: block;
}

/* ---------- Mode banner (shared links) ---------- */

.mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--cyan);
    font-size: 14px;
    color: var(--ink);
}

.mode-banner strong {
    color: var(--ink-strong);
}

/* ---------- Add coins ---------- */

.add-bar {
    position: relative;
    z-index: 35; /* Its search results and category popover sit above the tray */
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 26px;
    padding: 16px;
    border-radius: 14px;
    background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line);
}

.add-row {
    display: flex;
    gap: 10px;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

#coinInput {
    width: 100%;
    height: 46px;
    padding: 0 46px 0 43px;
    border: 0;
    border-radius: 999px;
    outline: none;
    background: var(--field);
    color: var(--ink-strong);
    font-size: 15px;
    box-shadow: inset 0 0 0 1px var(--field-ring);
    transition: box-shadow 0.15s;
}

#coinInput::placeholder {
    color: var(--muted);
    opacity: 1;
}

#coinInput:focus {
    box-shadow: inset 0 0 0 2px var(--cyan);
}

#coinInput.input-highlight {
    animation: nudge 0.4s var(--ease);
    box-shadow: inset 0 0 0 2px var(--tier-b);
}

.search-kbd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#coinInput:focus ~ .search-kbd {
    display: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 45;
    display: none;
    max-height: 340px;
    overflow-y: auto;
    padding: 6px;
    border-radius: 12px;
    background: var(--popover);
    box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
}

.search-item:hover,
.search-item:focus-visible,
.search-item.is-active {
    background: var(--hover);
}

.search-item.no-results {
    cursor: default;
    color: var(--muted);
    font-size: 14px;
}

.search-item.no-results:hover {
    background: none;
}

.search-logo {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    object-fit: contain;
    background: var(--logo-bg);
}

.search-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.search-name {
    overflow: hidden;
    color: var(--ink-strong);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-symbol {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.browse {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.browse-label {
    color: var(--muted);
    font-size: 12.5px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    min-height: 34px;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--btn-ring);
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}

.chip:hover {
    background: var(--hover);
    color: var(--ink-strong);
}

.chip[aria-expanded="true"] {
    background: var(--accent-bg);
    color: var(--ink-strong);
    box-shadow: inset 0 0 0 1px var(--cyan);
}

.catalog {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    max-height: min(68vh, 540px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    border-radius: 14px;
    background: var(--popover);
    box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
}

.catalog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.catalog-head h2 {
    color: var(--ink-strong);
    font-size: 16px;
    font-weight: 650;
    line-height: 1.3;
}

.catalog-note {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.catalog-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.catalog-tabs {
    display: none;
}

.catalog-tab {
    flex: none;
    min-height: 32px;
    padding: 5px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--btn-ring);
}

.catalog-tab[aria-pressed="true"] {
    background: var(--accent-bg);
    color: var(--ink-strong);
    box-shadow: inset 0 0 0 1px var(--cyan);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 6px;
}

.catalog-coin {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: var(--field);
    color: var(--ink-strong);
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--line);
    transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.catalog-coin:hover {
    box-shadow: inset 0 0 0 1px var(--btn-ring);
    background: var(--hover);
}

.catalog-coin img {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    object-fit: contain;
    background: var(--logo-bg);
}

.cc-text {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.cc-sym {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.cc-name {
    overflow: hidden;
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cc-state {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: none;
    margin-left: auto;
    border-radius: 50%;
    color: var(--cyan);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    box-shadow: inset 0 0 0 1px var(--btn-ring);
}

.catalog-coin.is-added {
    cursor: default;
}

.catalog-coin.is-added .cc-state {
    background: var(--accent-bg);
    color: var(--ink-strong);
    box-shadow: none;
}

.catalog-coin.is-added img,
.catalog-coin.is-added .cc-text {
    opacity: 0.6;
}

/* ---------- Board ---------- */

.board {
    outline: none;
}

.board-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px 24px;
    margin-bottom: 14px;
}

.board-meta h2 {
    font-family: var(--display);
    font-weight: 450;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--ink-strong);
}

.board-status {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.board-status span:not(.dot) {
    color: var(--ink-strong);
    font-weight: 650;
}

.board-status .dot {
    margin: 0 4px;
}

.board-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Visitors submit, the reviewer and verdict viewers share. */
body.mode-review .submit-btn,
body.mode-verdict .submit-btn,
body.mode-review #submitBtn,
body.mode-verdict #submitBtn {
    display: none;
}

.menu-wrap {
    position: relative;
}

.menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    display: grid;
    min-width: 260px;
    padding: 6px;
    border-radius: 12px;
    background: var(--popover);
    box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
}

.menu-item {
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-strong);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
    background: var(--hover);
}

.menu-item-danger {
    color: var(--danger-ink);
}

.tier-helper {
    display: none;
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.55;
}

.tier-helper.visible {
    display: block;
}

.tier-helper strong {
    color: var(--ink-strong);
}

/* ---------- Tiers ---------- */

.tier-list {
    display: grid;
    gap: 6px;
}

.tier-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    overflow: hidden;
    border-radius: 12px;
    background: var(--row);
    box-shadow: inset 0 0 0 1px var(--line);
}

.tier-s { --tier-color: var(--tier-s); }
.tier-a { --tier-color: var(--tier-a); }
.tier-b { --tier-color: var(--tier-b); }
.tier-c { --tier-color: var(--tier-c); }
.tier-d { --tier-color: var(--tier-d); }
.tier-f { --tier-color: var(--tier-f); }

.tier-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 8px;
    background: var(--tier-color);
    color: var(--tier-ink);
    text-align: center;
}

.tier-letter {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

body.degen-mode .tier-letter {
    font-size: 21px;
}

.tier-name {
    max-width: 100%;
    padding: 2px 4px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.05em;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: background 0.15s;
}

.tier-name:hover {
    background: rgba(19, 32, 42, 0.13);
}

.tier-name-input {
    width: 84px !important;
    color: var(--tier-ink) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.07em;
}

.tier-count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: rgba(19, 32, 42, 0.16);
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tier-count.empty {
    opacity: 0.55;
}

.tier-content {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    gap: 4px;
    min-height: 86px;
    padding: 8px 10px;
    transition: background 0.15s, box-shadow 0.15s;
}

.tier-content.empty {
    align-content: center;
}

.tier-content.empty::after {
    content: "Drop coins here";
    padding-left: 6px;
    color: var(--muted);
    font-size: 13px;
    opacity: 0.8;
}

.tier-content.drag-over {
    background: color-mix(in srgb, var(--tier-color) 12%, transparent);
    box-shadow: inset 0 0 0 2px var(--tier-color);
}

/* ---------- Coins ---------- */

.coin {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 66px;
    padding: 7px 4px 6px;
    border-radius: 10px;
    color: var(--ink-strong);
    cursor: grab;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    animation: coinAppear 0.28s var(--ease) both;
    transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.coin:hover {
    background: var(--hover);
}

.coin-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--logo-bg);
    pointer-events: none;
    -webkit-user-drag: none;
}

/* A few logos are drawn dark (or light) on a transparent background. They
   sit on a contrasting disc so they stay visible in either theme. */
img[data-tone="dark"]:not(.is-monogram) {
    background: #e6ecef;
}

body.light-mode img[data-tone="light"]:not(.is-monogram) {
    background: #23313d;
}

/* A faint ring keeps the edge of very dark logos visible on the dark theme */
.coin-logo:not(.is-monogram),
.catalog-coin img:not(.is-monogram),
.search-logo:not(.is-monogram),
.tier-picker-logo:not(.is-monogram) {
    box-shadow: 0 0 0 1px rgba(230, 236, 239, 0.12);
}

body.light-mode .coin-logo:not(.is-monogram),
body.light-mode .catalog-coin img:not(.is-monogram),
body.light-mode .search-logo:not(.is-monogram),
body.light-mode .tier-picker-logo:not(.is-monogram) {
    box-shadow: 0 0 0 1px rgba(19, 32, 42, 0.1);
}

.coin-text {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.coin-remove {
    position: absolute;
    top: 1px;
    right: 2px;
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--raised);
    color: var(--ink);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    box-shadow: inset 0 0 0 1px var(--btn-ring);
    transition: opacity 0.15s, background 0.15s;
}

.coin:hover .coin-remove,
.coin:focus-visible .coin-remove,
.coin-remove.confirm {
    opacity: 1;
}

.coin-remove:hover {
    background: #6b2e2a;
    color: #fff;
}

.coin-remove.confirm {
    z-index: 2;
    padding: 0 7px;
    background: #8f3b35;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    box-shadow: none;
}

.coin.dragging,
.coin.drag-source {
    opacity: 0.35;
}

.coin.keyboard-selected,
.coin.is-picking {
    background: var(--accent-bg);
    box-shadow: inset 0 0 0 2px var(--cyan);
}

.coin.removing {
    animation: coinRemove 0.25s ease-out forwards;
    pointer-events: none;
}

.coin.touch-dragging {
    z-index: 1000;
    background: var(--popover);
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.7), inset 0 0 0 2px var(--cyan);
    opacity: 0.96;
    animation: none;
    transition: none;
    pointer-events: none;
    will-change: left, top;
}

.coin.insert-before::before,
.coin.insert-after::after {
    content: "";
    position: absolute;
    top: 12%;
    z-index: 3;
    width: 3px;
    height: 76%;
    border-radius: 2px;
    background: var(--cyan);
}

.coin.insert-before::before {
    left: -4px;
}

.coin.insert-after::after {
    right: -4px;
}

body.is-touch-dragging {
    user-select: none;
    -webkit-user-select: none;
}

/* ---------- Unranked tray ---------- */

.tray {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin-top: 18px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    background: var(--tray-bg);
    box-shadow:
        0 -22px 44px -26px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 var(--line),
        inset 1px 0 0 var(--line),
        inset -1px 0 0 var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.tray-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.tray-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.tray-title h2 {
    color: var(--ink-strong);
    font-size: 14px;
    font-weight: 650;
}

.count-pill {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    background: var(--accent-bg);
    color: var(--ink-strong);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.count-pill.bump {
    animation: bump 0.35s var(--ease);
}

.tray-hint {
    margin-right: auto;
    overflow: hidden;
    color: var(--muted);
    font-size: 12.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hint-touch {
    display: none;
}

#trayToggle svg {
    transition: transform 0.2s var(--ease);
}

.tray-col {
    display: contents;
}

.coin-grid {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 4px;
    scrollbar-width: thin;
    min-height: 64px;
    max-height: clamp(128px, 27vh, 252px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px;
    border-radius: 10px;
    transition: background 0.15s, box-shadow 0.15s, max-height 0.2s var(--ease);
}

/* Docked tray before the board is reached: one row, so the top of the page
   stays readable. It grows once the board scrolls into view. */
.tray.is-compact .coin-grid {
    max-height: 78px;
}

.coin-grid.drag-over {
    background: var(--hover);
    box-shadow: inset 0 0 0 2px var(--cyan);
}

.tray.is-collapsed .coin-grid,
.tray.is-collapsed .tray-hint {
    display: none;
}

.tray.is-collapsed .tray-head {
    margin-bottom: 0;
}

.tray.is-collapsed .tray-title {
    margin-right: auto;
}

.tray.is-collapsed #trayToggle svg {
    transform: rotate(180deg);
}

.pool-empty-state {
    align-self: center;
    width: 100%;
    padding: 12px 8px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
    text-align: center;
}

.pool-empty-state strong {
    color: var(--ink-strong);
}

/* ---------- Tier picker ---------- */

.tier-picker {
    position: absolute;
    z-index: 70;
    width: 316px;
    padding: 12px;
    border-radius: 14px;
    background: var(--popover);
    box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
    animation: popIn 0.16s var(--ease);
}

.tier-picker-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tier-picker-logo {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    object-fit: contain;
    background: var(--logo-bg);
}

.tier-picker-id {
    display: grid;
    min-width: 0;
    margin-right: auto;
    line-height: 1.3;
}

.tier-picker-id strong {
    color: var(--ink-strong);
    font-size: 15px;
}

.tier-picker-id span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tier-picker-label {
    margin: 12px 0 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.tier-picker-tiers {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.pick {
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--tier-color);
    color: var(--tier-ink);
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s, filter 0.15s, box-shadow 0.15s;
}

.pick:hover {
    filter: brightness(1.07);
}

.pick:active {
    transform: scale(0.96);
}

.pick.is-current {
    box-shadow: 0 0 0 2px var(--popover), 0 0 0 4px var(--ink-strong);
}

body.degen-mode .pick {
    font-size: 13px;
}

.pick-s { --tier-color: var(--tier-s); }
.pick-a { --tier-color: var(--tier-a); }
.pick-b { --tier-color: var(--tier-b); }
.pick-c { --tier-color: var(--tier-c); }
.pick-d { --tier-color: var(--tier-d); }
.pick-f { --tier-color: var(--tier-f); }

.tier-picker-foot {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.tier-picker-foot .btn {
    flex: 1;
}

/* ---------- Toasts ---------- */

#toastStack {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 150;
    display: grid;
    gap: 8px;
    width: min(440px, calc(100% - 24px));
    transform: translateX(-50%);
    pointer-events: none;
}

.notification-toast,
.undo-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--toast);
    color: var(--ink-strong);
    font-size: 13.5px;
    line-height: 1.45;
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.7), inset 0 0 0 1px var(--line), inset 3px 0 0 var(--cyan);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: auto;
    transition: opacity 0.2s, transform 0.2s;
}

.notification-toast.show,
.undo-toast.visible {
    opacity: 1;
    transform: none;
}

.notification-toast.hiding,
.undo-toast.hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.notification-toast.error {
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.7), inset 0 0 0 1px var(--line), inset 3px 0 0 var(--tier-d);
}

.notification-toast.warning {
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.7), inset 0 0 0 1px var(--line), inset 3px 0 0 var(--tier-b);
}

.undo-toast-message {
    flex: 1;
}

.undo-toast-btn {
    padding: 4px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cyan);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.undo-toast-btn:hover {
    background: var(--hover);
}

/* ---------- Dialogs ---------- */

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 9, 13, 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.2s;
}

.confirm-modal-overlay.visible {
    opacity: 1;
}

.confirm-modal-overlay.hiding {
    opacity: 0;
}

.confirm-modal {
    width: min(420px, 100%);
    padding: 22px;
    border-radius: 16px;
    background: var(--popover);
    box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
    transform: translateY(8px);
    transition: transform 0.2s var(--ease);
}

.confirm-modal-overlay.visible .confirm-modal {
    transform: none;
}

.confirm-modal-message {
    margin-bottom: 18px;
    color: var(--ink-strong);
    font-size: 15px;
    line-height: 1.55;
}

.confirm-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.confirm-modal-btn {
    min-height: 38px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--raised);
    color: var(--ink-strong);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--btn-ring);
}

.confirm-modal-btn:hover {
    background: var(--raised-hover);
}

.confirm-modal-btn.confirm {
    background: var(--primary);
    color: var(--primary-ink);
    box-shadow: none;
}

.confirm-modal-btn.confirm:hover {
    background: var(--primary-hover);
}

.confirm-modal-btn.confirm.danger {
    background: #8f3b35;
    color: #fff;
}

.confirm-modal-btn.confirm.danger:hover {
    background: #a3443d;
}

.confirm-modal.share-fallback {
    width: min(500px, 100%);
}

.share-fallback-input {
    width: 100%;
    margin-bottom: 18px;
    padding: 11px 12px;
    border: 0;
    border-radius: 10px;
    background: var(--field);
    color: var(--ink-strong);
    font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    box-shadow: inset 0 0 0 1px var(--line);
}

.share-fallback-input:focus {
    outline: 2px solid var(--cyan);
    outline-offset: 1px;
}

.help-modal-overlay,
.cmd-palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 9vh 16px 16px;
    background: rgba(5, 9, 13, 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.help-modal-overlay.visible,
.cmd-palette-overlay.visible {
    display: flex;
}

.help-modal {
    position: relative;
    width: min(560px, 100%);
    max-height: 82vh;
    overflow-y: auto;
    padding: 26px;
    border-radius: 16px;
    background: var(--popover);
    box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
    animation: popIn 0.18s var(--ease);
}

.help-close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.help-modal h2 {
    margin-bottom: 12px;
    color: var(--ink-strong);
    font-family: var(--display);
    font-size: 26px;
    font-weight: 450;
    line-height: 1.2;
}

.help-steps {
    display: grid;
    gap: 8px;
    padding-left: 20px;
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.55;
}

.help-steps strong {
    color: var(--ink-strong);
}

.help-modal h2.help-shortcuts-title {
    margin-top: 24px;
    font-size: 19px;
}

.help-shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 13.5px;
}

.help-shortcut-row:last-child {
    border-bottom: 0;
}

.help-shortcut-keys {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: none;
    color: var(--muted);
    font-size: 12px;
}

kbd {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 6px;
    background: var(--raised);
    box-shadow: inset 0 -1px 0 var(--line), inset 0 0 0 1px var(--btn-ring);
    color: var(--ink-strong);
    font-family: var(--sans);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
}

.cmd-palette {
    width: min(560px, 100%);
    overflow: hidden;
    border-radius: 16px;
    background: var(--popover);
    box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line);
    animation: popIn 0.18s var(--ease);
}

.cmd-palette-input {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    border: 0;
    border-bottom: 1px solid var(--line);
    outline: none;
    background: transparent;
    color: var(--ink-strong);
    font-size: 15px;
}

.cmd-palette-input::placeholder {
    color: var(--muted);
}

.cmd-palette-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: 6px;
}

.cmd-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.cmd-palette-item.active {
    background: var(--hover);
}

.cmd-palette-item img {
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 50%;
    object-fit: contain;
    background: var(--logo-bg);
}

.cmd-palette-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.cmd-palette-name {
    overflow: hidden;
    color: var(--ink-strong);
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cmd-palette-symbol {
    color: var(--muted);
    font-size: 12px;
}

.cmd-palette-empty {
    padding: 18px;
    color: var(--muted);
    font-size: 13.5px;
    text-align: center;
}

.cmd-palette-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

/* ---------- Footer ---------- */

.tl-footer {
    padding: 34px 0 48px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.tl-footer strong {
    color: var(--ink);
}

.tl-footer a {
    color: var(--cyan);
    text-decoration: none;
}

.tl-footer a:hover {
    text-decoration: underline;
}

.tl-footer-meta {
    margin-top: 6px;
    font-size: 12px;
}

/* ---------- Loading states ---------- */

.coin-skeleton-logo,
.coin-skeleton-text {
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.6s linear infinite;
}

.coin-skeleton-text {
    border-radius: 4px;
}

body.light-mode .coin-skeleton-logo,
body.light-mode .coin-skeleton-text {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.09) 50%, rgba(0, 0, 0, 0.04) 100%);
    background-size: 200% 100%;
}

.confetti-particle {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* ---------- Focus ---------- */

a:focus-visible,
button:focus-visible,
.coin:focus-visible,
.search-item:focus-visible,
.tier-name:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.coin:focus-visible {
    outline-offset: 1px;
}

/* ---------- Animation ---------- */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes coinAppear {
    from { opacity: 0; transform: scale(0.88); }
    to { opacity: 1; transform: none; }
}

@keyframes coinRemove {
    to { opacity: 0; transform: scale(0.8); }
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes bump {
    40% { transform: scale(1.18); }
}

@keyframes nudge {
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes confetti-burst {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(var(--end-x), var(--end-y)) rotate(var(--spin)) scale(0.5); opacity: 0; }
}

/* ---------- Wide screens: the tray becomes a column beside the board ---------- */

@media (min-width: 1100px) {
    .workspace {
        display: grid;
        grid-template-columns: minmax(0, 1fr) clamp(324px, 22vw, 480px);
        gap: 24px;
    }

    .board {
        align-self: start;
    }

    /* The column is as tall as the board (its own content does not count),
       so the tray inside can stick without stretching the page */
    .tray-col {
        display: block;
        contain: size;
    }

    .tray {
        position: sticky;
        top: 16px;
        bottom: auto;
        display: flex;
        flex-direction: column;
        max-height: min(100%, calc(100vh - 32px));
        max-height: min(100%, calc(100dvh - 32px));
        margin-top: 0;
        padding: 14px 12px 12px;
        border-radius: 16px;
        background: var(--panel);
        box-shadow: inset 0 0 0 1px var(--line);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .tray-head {
        flex-wrap: wrap;
        gap: 6px 10px;
        margin-bottom: 12px;
        padding: 0 2px;
    }

    .tray-title {
        margin-right: auto;
    }

    .tray-hint {
        flex-basis: 100%;
        margin: 0;
        white-space: normal;
    }

    #trayToggle {
        display: none;
    }

    .coin-grid,
    .tray.is-compact .coin-grid {
        flex: 1 1 auto;
        min-height: 120px;
        max-height: none;
    }

    /* Collapsing is for the docked tray only */
    .tray.is-collapsed .coin-grid {
        display: flex;
    }

    .tray.is-collapsed .tray-hint {
        display: block;
    }

    .tray.is-collapsed .tray-head {
        margin-bottom: 12px;
    }
}

/* ---------- Big monitors: use the room ---------- */

@media (min-width: 1400px) {
    /* Search and categories share one row */
    .add-bar {
        display: flex;
        align-items: center;
        gap: 12px 28px;
    }

    .add-row {
        flex: 1 1 auto;
        max-width: 880px;
    }

    .browse {
        margin-left: auto;
        flex-wrap: nowrap;
    }
}

@media (min-width: 1700px) {
    .tier-row {
        grid-template-columns: 128px minmax(0, 1fr);
    }

    .tier-letter {
        font-size: 36px;
    }

    body.degen-mode .tier-letter {
        font-size: 24px;
    }

    .tier-name {
        font-size: 10.5px;
    }

    .tier-content {
        min-height: 104px;
        padding: 10px 12px;
        gap: 6px;
    }

    .coin {
        width: 76px;
        padding: 8px 4px 7px;
    }

    .coin-logo {
        width: 50px;
        height: 50px;
    }

    .coin-text {
        font-size: 12px;
    }
}

@media (min-width: 2200px) {
    .tier-row {
        grid-template-columns: 136px minmax(0, 1fr);
    }

    .tier-letter {
        font-size: 40px;
    }

    .tier-name {
        font-size: 11px;
    }

    .tier-content {
        min-height: 116px;
    }

    .coin {
        width: 84px;
    }

    .coin-logo {
        width: 56px;
        height: 56px;
    }

    .coin-text {
        font-size: 12.5px;
    }
}

/* ---------- Touch devices ---------- */

@media (hover: none) {
    /* Removal lives in the tier picker on touch screens. */
    .coin-remove {
        display: none;
    }

    .coin:hover {
        background: none;
    }

    .tier-content.empty::after {
        content: "Empty";
    }

    .search-kbd {
        display: none;
    }

    .hint-pointer {
        display: none;
    }

    .hint-touch {
        display: inline;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .page {
        width: calc(100% - 40px);
    }

    .tl-header {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 40px;
    }

    .board-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .page {
        width: calc(100% - 28px);
    }

    .site-nav {
        flex-wrap: wrap;
        gap: 10px;
        min-height: 0;
        padding: 18px 0 8px;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        font-size: 11px;
    }

    .nav-links .nav-contact {
        padding: 0;
        background: none;
    }

    .nav-links .nav-contact:hover {
        background: none;
        color: var(--cyan);
    }

    .tl-header {
        gap: 16px;
        padding: 26px 0 18px;
    }

    .tl-header h1 {
        font-size: clamp(36px, 10vw, 44px);
    }

    .lede {
        margin-top: 10px;
        font-size: 15px;
    }

    .add-bar {
        margin-bottom: 22px;
        padding: 12px;
    }

    .browse {
        flex-wrap: nowrap;
    }

    .browse-label {
        flex: none;
    }

    .chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-right: -12px;
        padding-right: 12px;
        scrollbar-width: none;
    }

    .chips::-webkit-scrollbar {
        display: none;
    }

    .chip {
        flex: none;
    }

    .catalog {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        z-index: 90;
        max-height: 72vh;
        padding: 14px;
    }

    .catalog-head {
        flex-direction: column;
        gap: 10px;
    }

    .catalog-actions {
        width: 100%;
    }

    .catalog-actions .btn {
        flex: 1;
    }

    .catalog-tabs {
        display: flex;
        gap: 6px;
        margin: -2px -14px 12px;
        padding: 0 14px 2px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .catalog-tabs::-webkit-scrollbar {
        display: none;
    }

    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .board-meta h2 {
        font-size: 26px;
    }

    .board-actions {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        width: 100%;
    }

    .board-actions .btn {
        min-width: 0;
        padding-inline: 10px;
    }

    #exportBtn {
        grid-column: 1;
    }

    #shareBtn {
        grid-column: 2;
    }

    .menu-wrap {
        grid-column: 3;
        grid-row: 1;
    }

    .tier-row {
        grid-template-columns: 78px minmax(0, 1fr);
    }

    .tier-label {
        padding: 8px 4px;
    }

    .tier-letter {
        font-size: 24px;
    }

    body.degen-mode .tier-letter {
        font-size: 16px;
    }

    .tier-name {
        padding: 1px 2px;
        font-size: 8px;
        letter-spacing: 0.02em;
    }

    .tier-content {
        min-height: 70px;
        padding: 6px;
        gap: 2px;
    }

    .coin {
        width: 56px;
        gap: 4px;
        padding: 6px 2px 5px;
    }

    .coin-logo {
        width: 36px;
        height: 36px;
    }

    .coin-text {
        font-size: 10px;
    }

    .tray {
        margin-top: 14px;
        margin-inline: -14px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        border-radius: 16px 16px 0 0;
    }

    .tray-hint {
        font-size: 12px;
    }

    .coin-grid {
        max-height: clamp(116px, 30vh, 220px);
    }

    .tier-picker {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto !important;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        width: auto;
        padding: 14px;
    }

    .pick {
        height: 52px;
        font-size: 18px;
    }

    .tl-footer {
        padding-bottom: 36px;
    }
}

@media (max-width: 380px) {
    .tray-hint {
        display: none;
    }

    .tray-title {
        margin-right: auto;
    }

    .coin {
        width: 52px;
    }

    .coin-logo {
        width: 34px;
        height: 34px;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .coin-grid {
        max-height: 96px;
    }

    .tl-header {
        padding-top: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .tray,
    .add-bar,
    .board-actions,
    .tl-prefs,
    #toastStack {
        display: none !important;
    }
}
