/* The sticker look (loaded last, so it wins over the plain rules before it). A sticker is a
   surface with a thin blue line inside a white ring and no blurred shadow (tokens in style.css). Buttons are pressed in with a hard edge under them; the
   current place (tab, sidebar page) is yellow or a white sticker. */

/* ---- stickers ---- */
.settings-card, .auth-card, .notice, .table, .post-row, .post-preview, .server-storage, .mp-card,
.menu, .toast, .unsaved-bar, .mc-pane, .await-note, .fw-card {
  border: var(--sticker-w) solid var(--sticker-line);
  box-shadow: var(--sticker-ring);
}
.dialog {
  border: var(--sticker-w) solid var(--sticker-line);
  box-shadow: var(--sticker-ring);
  background: var(--surface);
}
.dialog::backdrop { background: rgba(8, 14, 43, 0.45); -webkit-backdrop-filter: none; backdrop-filter: none; }
.text-row, .fieldset, .device-list, .share-result, .guide-fallback, .guide-notes, .guide-wait, .approve-who { border: 1.5px solid var(--separator); }
/* Inside a sticker a table needs no second frame. */
.auth-card .notice { border: 0; box-shadow: none; }
.table { background: var(--surface); }
@container table-wrap (max-width: 800px) {
  .table { border: 0; box-shadow: none; }
  .table tr { border: var(--sticker-w) solid var(--sticker-line); box-shadow: var(--sticker-ring); margin-bottom: 14px; }
}
.toast { background: var(--surface); }
.toast.error { background: var(--error-soft); color: var(--error); border-color: var(--error); }
.unsaved-bar { background: var(--surface); }

/* ---- the banner cards of computers and servers: the picture stays, the edge becomes a sticker ---- */
.computer-banner { border: var(--sticker-w) solid var(--sticker-line); box-shadow: var(--sticker-ring); }
.computer-panel { border: var(--sticker-w) solid var(--sticker-line); box-shadow: var(--sticker-ring); }

/* ---- the sections, banners and the tab bar of a server's page get the same line ---- */
.mc-stat, .mc-players-section, .mc-settings-section, .mc-log, .fw-domain-row.big, .mc-editor {
  border: var(--sticker-w) solid var(--sticker-line);
  box-shadow: var(--sticker-ring);
}
.server-tab-slider { border: var(--sticker-w) solid var(--sticker-line); } /* the yellow button has the line; the bar around it and the modpack banner have none */
.mc-editor { box-shadow: var(--sticker-ring), 0 24px 60px rgba(0, 0, 0, 0.45); }

/* ---- buttons ---- */
.btn { border: 1.5px solid var(--separator); background: var(--surface); }
.btn:hover:where(:not(:disabled)) { background: var(--hover); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 62%, #000); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 62%, #000); }
.btn.primary:disabled:not([aria-busy="true"]) { border-color: var(--separator); box-shadow: none; }
.btn.danger, .btn.danger-outline { border-color: color-mix(in srgb, var(--error) 40%, transparent); }
.btn.ghost, .btn.icon-btn { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover:not(:disabled), .btn.icon-btn:hover, .btn.icon-btn[aria-expanded="true"] { background: var(--hover); }
.btn.dialog-close { border-color: transparent; background: var(--fill); }
/* ---- inputs ---- */
.input { border: 1.5px solid var(--separator); background: var(--surface); }
.input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.switch { border: 1.5px solid var(--separator); }
.switch:checked { border-color: var(--accent); }
.chip-btn, .texts-cat { border: 1.5px solid var(--separator); background: var(--surface); }
.texts-cat[aria-pressed="true"] { border-color: var(--accent); }
.check-input:checked { border: 0; }
.check-input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.6 9.3l3 3 5.9-6.3' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* ---- the sidebar: white; the current page is a yellow sticker stuck on it ---- */
.side-link { border: 1.5px solid transparent; }
.side-link .side-icon { color: var(--accent); }
.side-link[aria-current="page"] {
  border-color: var(--sticker-line);
  background: var(--yellow);
  box-shadow: var(--sticker-ring-sm);
  color: var(--on-yellow);
  animation: side-stick 0.46s cubic-bezier(0.2, 1.35, 0.4, 1) both;
}
.side-link[aria-current="page"] .side-icon { color: var(--on-yellow); }
/* Stuck on: it comes down a little big and crooked, squashes in and settles. */
@keyframes side-stick {
  0% { opacity: 0.4; transform: translateY(-6px) scale(1.14) rotate(-5deg); }
  55% { opacity: 1; transform: translateY(0) scale(0.96) rotate(1deg); }
  100% { transform: none; }
}
@media (max-width: 760px) {
  .side-link[aria-current="page"] { border-color: transparent; box-shadow: none; background: transparent; color: var(--accent); animation: none; }
  .side-link[aria-current="page"] .side-icon { color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .side-link[aria-current="page"] { animation: none; } }

/* ---- tabs of a server's page: the current one is yellow ---- */
.server-tabs { background: var(--fill); }
.server-tab-slider { background: var(--yellow); }
.server-tab[aria-current="page"], .server-tab[aria-current="page"]:hover { color: var(--on-yellow); }
.server-tabs:not(.settled) .server-tab[data-from] { color: var(--on-yellow); }
.texts-tab.is-current { background: var(--yellow); color: var(--on-yellow); }

/* ---- the mode slider (views/theme-card.js), above the account button: only the slider ---- */
.theme-card { display: flex; justify-content: center; margin: 0 12px 6px; padding: 4px 0; }
.theme-card[hidden] { display: none; }
@media (max-width: 760px) { .theme-card { display: none; } }
@media (max-height: 560px) { .theme-card { display: none; } }

/* The slider: a sun on the left, a moon on the right, a round knob that slides to the mode that is on. */
.theme-switch {
  position: relative;
  display: block;
  width: 92px;
  height: 44px;
  margin: 0 auto;
  padding: 0;
  border: var(--sticker-w) solid var(--sticker-line);
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted);
  cursor: pointer;
}
.theme-switch > .icon { position: absolute; top: 12px; width: 20px; height: 20px; stroke-width: 2.2; }
.theme-switch > .theme-sun { left: 12px; }
.theme-switch > .theme-moon { right: 12px; }
.theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: var(--sticker-w) solid var(--sticker-line);
  border-radius: 50%;
  background: var(--yellow);
  color: #1b2547;
  transition: transform 0.25s cubic-bezier(0.3, 1.3, 0.5, 1), background-color 0.2s ease;
}
.theme-knob .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.theme-switch[data-mode="dark"] .theme-knob { transform: translateX(48px); background: var(--pink); }
.theme-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .theme-knob { transition: none; } }

/* ---- frosted cards: the pattern behind the page shows through them, blurred, as through the sidebar ---- */
.settings-card, .auth-card, .server-storage, .fw-card, .fw-domain-row.big, .notice, .table, .post-row, .post-preview, .mc-pane, .mp-card,
.mc-players-section, .mc-settings-section, .add-card, .add-choice, .tpl-pick, .await-note, .mc-stat {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(calc(var(--frost) * 22px)) saturate(calc(100% + var(--frost) * 50%));
  backdrop-filter: blur(calc(var(--frost) * 22px)) saturate(calc(100% + var(--frost) * 50%));
}
.auth-card .notice { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.fw-card[data-state="error"] { border-color: var(--error); box-shadow: var(--sticker-ring); }
@container table-wrap (max-width: 800px) {
  .table { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .table tr { background: var(--card-glass); -webkit-backdrop-filter: blur(calc(var(--frost) * 22px)) saturate(calc(100% + var(--frost) * 50%)); backdrop-filter: blur(calc(var(--frost) * 22px)) saturate(calc(100% + var(--frost) * 50%)); }
}

/* ---- a server's page and the pages of adding one (second level): the whole background is frosted like the sidebar, for reading ---- */
.page.server-veil { background: var(--veil); -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%); }

/* ---- the colourful pattern behind the page (the logo's blue, pink, yellow and white), and the frosted sidebar ---- */
body { background-image: var(--pattern); background-size: 380px 380px; background-attachment: fixed; }
.sidebar { -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%); }
@media (max-width: 760px) {
  .sidebar { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sidebar::before { -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%); }
  .side-nav { -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%); }
}

/* ---- the sign-in pages: the paper, and the card as a sticker ---- */
.auth-page { background: none; }
/* the fields and plain buttons of the sign-in card have the card's blue line, not the pale one */
.auth-card .input, .auth-card .btn:not(.primary):not(.ghost):not(.icon-btn), .auth-card .check-input:not(:checked) { border-color: var(--sticker-line); }


/* ---- spoilers (ui.js spoiler): an email address is blacked out until it is pressed ---- */
.spoiler:not(.shown) { padding: 0 6px; border-radius: 6px; background: var(--text); color: transparent; cursor: pointer; -webkit-user-select: none; user-select: none; transition: background-color 0.15s ease; }
.spoiler:not(.shown)::selection { background: transparent; color: transparent; }
.spoiler:not(.shown):hover { background: var(--muted); }
.spoiler.shown { cursor: text; }

/* ---- the titles and the logo are set in Baemin Hanna (the font has one weight: no faux bold) ---- */
.page-title, .auth-title, .auth-brand, .brand-name {
  font-family: "BM Hanna", var(--font);
  font-weight: 400;
  letter-spacing: 0;
}
