/*
 * Twitch Watcher - only what's its own. The look (colours, fonts, buttons, fields,
 * switches, cards, dialogs, the page frame ...) comes from ui/ui.css (resorted-ui).
 */
:root {
  --discord-bg: #313338;
  --discord-embed: #2b2d31;
}
code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--field);
}
.warn-text { color: var(--warn); }
.banner-link { margin-left: 4px; font-weight: 600; }

/* ---- Where to announce ---- */
#destinations .empty { align-items: center; text-align: center; }
.dest.off .card-head > :not(.switch):not(.btn) { opacity: 0.55; }
.card.dest { padding: 0; }
.card.dest .card-head { padding: 16px 18px; }
.dest-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; object-fit: cover; }
.dest-icon.blank { display: grid; place-items: center; background: var(--field); color: var(--muted); font: 700 1.2rem var(--font-display); }
.dest-main { flex: 1 1 260px; min-width: 0; }
.card-name { overflow-wrap: anywhere; }
.state { display: block; color: var(--faint); font-size: 13px; }
.state.bad { color: var(--bad); }
.state.warn { color: var(--warn); }
.chip.mention { border-color: rgba(88, 101, 242, 0.5); background: rgba(88, 101, 242, 0.18); color: #c9cdfb; }

/* ---- The editor (inside a card) ---- */
.editor { padding: 16px 18px 18px; border-top: 1px solid var(--line); }
/* The message editor: resorted-ui's (.msg-ed, .embed-box, .ed-item ...), plus what's this app's own */
.ed-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.ed-head .tab .tab-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 8px -1px var(--dot); }
.ed-head .tab .count { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--muted); font: 500 12px var(--font-mono); }
/* Phones: the three tabs on one row (the on/off counts are on the switches below anyway). */
@media (max-width: 560px) {
  .ed-head .tabs.boxed { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ed-head .tab { flex: 1 1 auto; padding: 0 8px; }
  .ed-head .tab .tab-dot { margin-right: 6px; }
  .ed-head .tab .count { display: none; }
}
.msg-ed.is-off .msg-ed-form, .preview.off { opacity: 0.55; }
.form-row { min-width: 0; }
.form-row .label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 6px; font-size: 14px; }
.form-row .label small { color: var(--faint); font-size: 12.5px; font-weight: 500; }
.ed-item .field { min-height: 38px; padding: 7px 12px; font-size: 14px; }
.ed-item-row .note { margin: 0; font-size: 13px; }
.toggle-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 999px; background: var(--card); font-size: 13px; cursor: pointer; }
.toggle-chip:has(input:checked) { border-color: rgba(79, 220, 255, 0.5); background: rgba(61, 139, 255, 0.14); }
.toggle-chip input { accent-color: var(--c2); margin: 0; }
.type-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.type-tab { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line2); border-radius: 12px; background: var(--field); }
.type-tab.on { border-color: rgba(79, 220, 255, 0.55); background: rgba(61, 139, 255, 0.12); box-shadow: 0 0 18px -10px var(--c1); }
.type-tab-name { padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 600 14px var(--font); cursor: pointer; }
.type-tab.off .type-tab-name { color: var(--muted); }
.ping-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ping-bar .chips { flex: 1; }
.reset-row { font-size: 13px; }
.preview-head .msg-ed-label { margin: 0; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.preview-head .label { margin: 0; }
.preview-head .rui-dd { max-width: 60%; }
.card-foot .test-note { flex: 1 1 160px; margin: 0; }

/* ---- Preview: a Discord message (Discord's own colours) ---- */
.preview { min-height: 120px; padding: 14px 12px; border-radius: 12px; background: var(--discord-bg); color: #dbdee1; font: 15px/1.375 'gg sans', 'Noto Sans', var(--font); }
.msg { display: flex; gap: 12px; }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 6px; }
.msg-head b { color: #fff; }
.msg-head small { color: #949ba4; font-size: 12px; }
.app-tag { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; }
.msg-content { margin: 2px 0 4px; overflow-wrap: anywhere; }
.preview .emote { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }
.mention { padding: 0 2px; border-radius: 3px; background: rgba(88, 101, 242, 0.3); color: #c9cdfb; font-weight: 500; }
.embed { display: flex; gap: 12px; max-width: 440px; margin-top: 4px; padding: 10px 14px 12px 12px; border-left: 4px solid var(--bar, var(--c2)); border-radius: 4px; background: var(--discord-embed); }
.embed-main { display: grid; flex: 1; gap: 6px; min-width: 0; }
.embed-author { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; font-weight: 600; }
.embed-author img { width: 20px; height: 20px; border-radius: 50%; }
.embed-title { color: #00a8fc; font-weight: 600; text-decoration: none; }
.embed-desc { font-size: 14px; overflow-wrap: anywhere; }
.embed-desc a, .embed-field a { color: #00a8fc; text-decoration: none; }
.embed-fields { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.embed-field { display: grid; }
.embed-field.full { flex-basis: 100%; }
.embed-field b { color: #fff; }
.embed-footer { color: #949ba4; font-size: 12px; }
.embed-thumb { flex: none; width: 72px; height: 72px; object-fit: contain; }
.embed-image { justify-self: start; max-width: 100%; max-height: 120px; object-fit: contain; }
.msg-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg-button { padding: 5px 14px; border-radius: 4px; background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; text-decoration: none; }
.time { padding: 0 2px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); }

/* ---- Dialogs: picking a server and channel ---- */
.channels-wrap .label { margin-top: 16px; }
.channel-list { display: grid; max-height: 46vh; overflow: auto; padding: 4px; border: 1px solid var(--line2); border-radius: 12px; background: var(--field); }
.channel-cat { margin: 10px 8px 4px; color: var(--faint); font: 600 11px var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; }
.channel { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--text); font: 500 15px var(--font); text-align: left; cursor: pointer; }
.channel:hover:not(:disabled) { background: radial-gradient(150px circle at var(--mx) var(--my), var(--glow), transparent 70%), var(--card2); }
.channel:disabled { opacity: 0.5; cursor: default; }
.channel.current { background: rgba(61, 139, 255, 0.14); opacity: 1; }
.channel .hash { width: 18px; color: var(--muted); text-align: center; }
.dialog #bot-missing .btn { margin-left: 6px; }

/* ---- Latest / all badges and emotes ---- */
.browse-head-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.status-line { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; }
/* In the dashboard the menu on the left picks Latest / All, and the top bar shows the status. */
#view-browse .browse-head { display: none; }
#view-browse .browse { padding: 6px 0 0; }
.latest-note { margin: 0 4px 10px; }
.latest-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.latest-head .latest-note { margin: 0 4px; }
.feed-more { align-self: center; margin: 8px 0; }
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; color: var(--text); text-decoration: none; transition: box-shadow 0.15s; }
.feed-item:hover { color: var(--text); background: radial-gradient(240px circle at var(--mx) var(--my), rgba(79, 220, 255, 0.13), transparent 70%), var(--card2); box-shadow: inset 0 0 0 1px rgba(79, 220, 255, 0.18); }
.feed-item img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.feed-item.removed img { filter: grayscale(1); opacity: 0.6; }
.feed-text { display: grid; flex: 1; min-width: 0; }
.feed-text b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.feed-text small, .feed-item time { color: var(--faint); font-size: 13px; }
.feed-item time { font-family: var(--font-mono); white-space: nowrap; }
#view-browse .feed { padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.all-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.all-tools > .field { flex: 1 1 240px; width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
/* Every tile has the same rows (picture, name on up to 2 lines, streamer or "Global", status line at the bottom), so a row of tiles lines up. */
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 16px 10px 9px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font-size: 13px; text-align: center; text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tile:hover { color: var(--text); transform: translateY(-2px); border-color: rgba(79, 220, 255, 0.4); background: radial-gradient(140px circle at var(--mx) var(--my), rgba(79, 220, 255, 0.12), transparent 70%), var(--card2); box-shadow: 0 14px 30px -20px rgba(0, 0, 0, 0.9), 0 0 24px -14px rgba(79, 220, 255, 0.55); }
.tile img { flex: none; width: 44px; height: 44px; margin-bottom: 6px; object-fit: contain; }
.tile-name { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 2.6em; line-height: 1.3; font-weight: 600; }
.tile-name > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.tile-by { width: 100%; overflow: hidden; color: var(--faint); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); font: 600 12px var(--font); white-space: nowrap; }
.tile-meta .st { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); }
.tile-meta .st::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tile-meta .st.ok { color: #62e2aa; }
.tile-meta .st.soon { color: var(--warn); }
.tile-meta .st.bad { color: #ff9b9b; }
.tile-meta .st.faint { color: var(--faint); }
.tile-meta .cost.free { color: var(--text); }
.tile-meta .cost.paid { color: var(--muted); }
.tile.removed { opacity: 0.5; }
.tile .new { position: absolute; top: 7px; right: 7px; padding: 1px 7px; border-radius: 999px; background: rgba(60, 207, 145, 0.13); color: var(--ok); font: 700 10px var(--font-display); letter-spacing: 0.04em; }
.grid-more { grid-column: 1 / -1; }
.tags { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.tag.builtin { border-color: rgba(79, 220, 255, 0.4); color: #a6ecff; }
.tag.time { border-color: rgba(124, 200, 255, 0.4); color: var(--link); }
.tag.time.soon { border-color: rgba(245, 185, 66, 0.55); color: var(--warn); }
.tag.cost.free { color: var(--text); }
.tag.cost.paid { color: var(--muted); }
a.tag { text-decoration: none; }
a.tag:hover { color: var(--text); border-color: var(--line3); }

/* ---- A badge's / emote's page (item.html) ---- */
.item-back { position: absolute; top: 16px; left: max(16px, calc(50% - 540px)); z-index: 4; }
.item-back .btn { background: rgba(20, 27, 37, 0.7); border-color: var(--line2); color: var(--text); backdrop-filter: blur(10px); }
.item-page .rui-panel + .rui-panel { margin-top: 0; }
.item-head { gap: 14px; }
.item-image { flex: none; width: 80px; height: 80px; padding: 10px; border: 1px solid var(--line2); border-radius: 18px; background: var(--field); object-fit: contain; box-shadow: 0 0 40px -20px rgba(79, 220, 255, 0.6); }
.item-image.emote { width: 104px; height: 104px; }
.item-image.over { filter: grayscale(1); opacity: 0.7; }
.item-kind { color: var(--c1); font: 600 12px var(--font-display); letter-spacing: 0.18em; text-transform: uppercase; }
.item-page h1 { margin: 4px 0 0; font-size: 32px; line-height: 1.15; }
.item-page h2 { margin: 0 0 12px; font-size: 20px; }
.item-about p { margin: 0 0 10px; }
.item-note { padding-left: 12px; border-left: 3px solid var(--c2); }
.requirement { font-size: 17px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.facts .tag { padding: 3px 10px; font-size: 13px; }
.avail { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line2); border-radius: 14px; background: var(--field); }
.avail.ok { border-color: rgba(60, 207, 145, 0.45); background: rgba(60, 207, 145, 0.08); }
.avail.ok b { color: var(--ok); }
.avail.bad { border-color: rgba(255, 122, 122, 0.45); background: rgba(255, 122, 122, 0.08); }
.avail.bad b { color: var(--bad); }
.campaign { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--field); font-size: 14px; }
.elig + .elig { margin-top: 22px; }
.elig h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 16px; }
.elig h3 a { color: var(--text); }
.count { padding: 0 8px; border-radius: 999px; background: var(--field); color: var(--muted); font: 500 12px var(--font-mono); }
.boxart { width: 26px; height: 36px; border-radius: 4px; }
.streams { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stream { display: flex; gap: 10px; min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); color: var(--text); text-decoration: none; transition: border-color 0.15s; }
.stream:hover { color: var(--text); border-color: rgba(79, 220, 255, 0.4); background: radial-gradient(200px circle at var(--mx) var(--my), rgba(79, 220, 255, 0.1), transparent 70%), var(--field); }
.stream-thumb { flex: none; width: 96px; height: 54px; border-radius: 8px; object-fit: cover; }
.stream-thumb.blank { display: grid; place-items: center; background: var(--card); color: var(--muted); font-size: 1.2rem; font-weight: 600; }
.stream-thumb.avatar { object-fit: contain; background: var(--card); }
.stream-text { display: grid; min-width: 0; font-size: 14px; }
.stream-text small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.chips.offline .chip { color: var(--muted); }
.admin { border-style: dashed; }

@media (max-width: 760px) {

}
