/* Slot.win Mirrors — palette and type follow slot.win (dark charcoal, pink accent, Unbounded + Roboto). */
:root {
  color-scheme: dark;

  --bg: #101012;
  --surface: #151517;
  --surface-raised: #1c1c1e;
  --line: rgba(255, 255, 255, 0.06);
  --fill: rgba(255, 255, 255, 0.04);
  --fill-hover: rgba(255, 255, 255, 0.07);

  --text: #ffffff;
  --muted: #a9a9a9;
  --faint: rgba(255, 255, 255, 0.45);
  --placeholder: rgba(255, 255, 255, 0.48);

  --accent: #ee3872;
  --accent-deep: #e01c5c;
  --accent-text: #ff6a97;
  --accent-soft: rgba(238, 56, 114, 0.14);
  --accent-ring: rgba(238, 56, 114, 0.55);

  --online: #00c950;
  --online-ring: rgba(0, 201, 80, 0.18);
  --offline: #ff3b5c;
  --checking: #5d5d63;

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Unbounded", "Roboto", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 42% at 50% -8%, rgba(238, 56, 114, 0.2), transparent 72%),
    radial-gradient(40% 30% at 92% 4%, rgba(166, 132, 255, 0.08), transparent 70%),
    linear-gradient(180deg, #151517 0%, var(--bg) 46%);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- layout ---------- */

.page {
  width: 100%;
  max-width: 508px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: inline-flex;
  border-radius: 6px;
}

.logo img {
  display: block;
  width: 123px;
  height: 29px;
}

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

.icon-btn,
.pill-btn {
  display: inline-grid;
  place-items: center;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--muted);
  transition: background-color 0.15s, color 0.15s;
}

.icon-btn {
  width: 36px;
  border-radius: 50%;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.pill-btn {
  min-width: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.icon-btn:hover,
.pill-btn:hover {
  background: var(--fill-hover);
  color: var(--text);
}

/* ---------- language menu ---------- */

.lang {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 11px;
}

.lang-globe {
  width: 16px;
  height: 16px;
}

.lang-caret {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: transform 0.2s var(--ease-out);
}

.lang-btn[aria-expanded="true"] {
  background: var(--fill-hover);
  color: var(--text);
}

.lang-btn[aria-expanded="true"] .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 212px;
  max-height: min(420px, 70vh);
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  animation: drop 0.16s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.lang-menu[hidden] {
  display: none;
}

.lang-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}

.lang-item:hover,
.lang-item:focus-visible {
  background: var(--fill-hover);
  outline: none;
}

.lang-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lang-item-code {
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.lang-check {
  width: 16px;
  height: 16px;
  color: var(--accent-text);
  visibility: hidden;
}

.lang-item[aria-checked="true"] {
  background: var(--accent-soft);
}

.lang-item[aria-checked="true"] .lang-check {
  visibility: visible;
}

/* ---------- hero ---------- */

.hero {
  padding-top: 22px;
}

h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.cta {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 12px 18px;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 10px 28px -10px rgba(238, 56, 114, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s;
}

.cta::before {
  content: "";
  position: absolute;
  inset: -40px;
  z-index: -1;
  background: url("logo-pattern.svg") 0 0 / 220px 88px repeat;
  opacity: 0.1;
  transition: transform 0.6s var(--ease-out);
}

.cta:hover {
  box-shadow: 0 14px 32px -10px rgba(238, 56, 114, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cta:hover::before {
  transform: translate3d(18px, -6px, 0);
}

.cta:active {
  transform: scale(0.99);
}

.cta-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cta-text strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.cta-text small {
  font-size: 13px;
  opacity: 0.85;
}

.cta-arrow {
  flex: none;
  width: 20px;
  height: 20px;
  transition: transform 0.2s var(--ease-out);
}

.cta:hover .cta-arrow {
  transform: translateX(3px);
}

/* ---------- search + summary ---------- */

.mirrors {
  margin-top: 22px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--fill);
  transition: border-color 0.15s, background-color 0.15s;
}

.search:focus-within {
  border-color: var(--accent-soft);
  background: var(--fill-hover);
}

.search-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--placeholder);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 100%;
  padding: 0 14px 0 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--placeholder);
}

.search input::-webkit-search-cancel-button {
  filter: invert(1) opacity(0.5);
}

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin: 6px 2px 4px;
  color: var(--muted);
  font-size: 13px;
}

.summary-none {
  color: var(--accent-text);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 500;
}

.text-btn svg {
  width: 15px;
  height: 15px;
}

.text-btn:hover {
  color: #fff;
}

.text-btn:disabled {
  color: var(--faint);
  cursor: default;
}

.text-btn:disabled svg {
  animation: spin 0.9s linear infinite;
}

/* ---------- list ---------- */

.group {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.item {
  position: relative;
  background: var(--surface);
}

.item + .item {
  box-shadow: inset 0 1px 0 var(--line);
}

.item.is-moving {
  z-index: 1;
  transition: transform 0.42s var(--ease-out);
}

.item[hidden] {
  display: none;
}

.row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto 8px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s;
}

.row:hover {
  background: var(--fill);
}

.row:focus-visible {
  outline-offset: -2px;
  border-radius: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--checking);
  transition: background-color 0.3s, box-shadow 0.3s;
}

.is-checking .dot {
  animation: pulse 1.2s ease-in-out infinite;
}

.is-online .dot {
  background: var(--online);
  box-shadow: 0 0 0 3px var(--online-ring);
}

.is-offline .dot {
  background: var(--offline);
}

.host {
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.3s;
}

.is-offline .host {
  color: var(--faint);
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.latency {
  font-variant-numeric: tabular-nums;
}

.badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.badge-quiet {
  background: var(--fill-hover);
  color: var(--muted);
}

.skeleton {
  width: 44px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.chevron {
  width: 8px;
  height: 14px;
  color: var(--faint);
}

.empty {
  margin: 0;
  padding: 28px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- footer ---------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
  color: var(--faint);
  font-size: 13px;
  text-align: left;
}

.foot p {
  margin: 0;
}

.age {
  flex: none;
  padding: 2px 6px;
  border: 1.5px solid var(--faint);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

/* ---------- modal ---------- */

.modal {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.modal::backdrop {
  background: rgba(6, 6, 8, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: pop 0.22s var(--ease-out);
}

.modal-body {
  padding: 22px 22px 18px;
}

.modal h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.modal p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.modal form {
  margin: 18px 0 0;
}

.modal-close {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--fill-hover);
  font-weight: 500;
  transition: background-color 0.15s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.11);
}

/* ---------- motion ---------- */

@keyframes pulse {
  50% { opacity: 0.35; }
}

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

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

@keyframes drop {
  from { opacity: 0; transform: translateY(-4px); }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
}

@media (max-width: 380px) {
  h1 { font-size: 26px; }
  .row { gap: 10px; padding: 0 14px; }
}

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