/* AMONESPORTS Short — temă negru/roșu cu variantă albă */
:root {
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --card: #121215;
  --card-2: #18181c;
  --line: #27272d;
  --text: #f4f4f5;
  --muted: #9b9ba5;
  --accent: #e5202e;
  --accent-2: #ff3b4a;
  --on-accent: #fff;
  --glow: rgba(229, 32, 46, .22);
  --input: #0c0c0f;
  --ok: #22c55e;
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f7;
  --card: #ffffff;
  --card-2: #f3f3f5;
  --line: #e3e3e8;
  --text: #0b0b0d;
  --muted: #6a6a74;
  --accent: #d3111f;
  --accent-2: #ef2c3b;
  --on-accent: #fff;
  --glow: rgba(211, 17, 31, .12);
  --input: #fafafb;
  --ok: #16a34a;
  --shadow: 0 12px 32px rgba(0, 0, 0, .08);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
.glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, var(--glow), transparent 70%);
  z-index: 0;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.ic { flex: none; display: inline-block; vertical-align: middle; }

/* Layout */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
}
.wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}
.footer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  margin: 8px auto 0;
  padding: 0 16px calc(22px + env(safe-area-inset-bottom));
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner p { margin: 0; text-wrap: balance; }
.footer-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 4px 14px var(--glow);
}
.footer-line strong { color: var(--text); font-weight: 700; }
.footer-by a {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.footer-by a:hover { color: var(--accent-2); }

/* Brand + top actions */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 18px var(--glow);
}
.brand-text { display: flex; flex-direction: column; font-weight: 800; font-size: 18px; letter-spacing: -.02em; line-height: 1.05; }
.brand-text small { font-size: 9.5px; font-weight: 700; letter-spacing: .18em; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.seg a {
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
}
.seg a.on { color: var(--on-accent); background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.iconbtn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.iconbtn:hover { border-color: var(--accent); }
:root[data-theme="dark"] .theme-moon { display: none; }
:root[data-theme="light"] .theme-sun { display: none; }

/* Hero */
.hero { padding: 22px 2px 20px; text-align: center; }
.hero h1 { font-size: clamp(28px, 7.4vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.hero .lead { margin: 10px auto 0; max-width: 460px; color: var(--muted); font-size: 16px; }

/* Cards */
.card {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card h2 { font-size: 18px; letter-spacing: -.01em; }
.card h3 { font-size: 15px; }

/* Forms */
.label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field { position: relative; display: flex; align-items: center; }
.field-ic { position: absolute; left: 14px; color: var(--muted); display: grid; pointer-events: none; }
.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field .field-ic + .input { padding-left: 42px; }
.input::placeholder { color: var(--muted); opacity: .7; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.field.prefix { align-items: stretch; }
.prefix-text {
  display: flex;
  align-items: center;
  padding: 0 4px 0 14px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  background: var(--input);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 13px 0 0 13px;
}
.field.prefix .input { border-radius: 0 13px 13px 0; padding-left: 6px; }
.hint { margin-top: 8px; font-size: 13px; color: var(--muted); }
#adv { margin-top: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 4px 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.linkbtn:hover { color: var(--text); }
.linkbtn .ic-chevron-down { transition: transform .2s; }
.linkbtn[aria-expanded="true"] .ic-chevron-down { transform: rotate(180deg); }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 0;
  padding: 11px 13px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.alert.error { color: #ff6b76; background: rgba(229, 32, 46, .1); border-color: rgba(229, 32, 46, .35); }
.alert.ok { color: var(--ok); background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); }
:root[data-theme="light"] .alert.error { color: #b4101c; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: transform .08s, border-color .15s, background-color .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary {
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent;
  box-shadow: 0 8px 22px var(--glow);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger:hover { border-color: #e5202e; color: #ff6b76; }
.btn.block { width: 100%; margin-top: 16px; }
.btn.sm { min-height: 40px; padding: 8px 13px; font-size: 14px; border-radius: 11px; }
.btn.icon { min-width: 40px; min-height: 40px; padding: 0; border-radius: 11px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn .spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading .spin { display: inline-block; }
.btn.is-loading .ic { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Copy button states */
.btn[data-copy] .ic-check { display: none; color: var(--ok); }
.btn[data-copy] .lbl-done { display: none; }
.btn[data-copy].is-done .ic-copy, .btn[data-copy].is-done .lbl-copy { display: none; }
.btn[data-copy].is-done .ic-check { display: inline-block; }
.btn[data-copy].is-done .lbl-done { display: inline; }
.btn.primary[data-copy].is-done .ic-check { color: #fff; }

/* Result */
.result { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ok-badge { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--ok); }
.shortbox {
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
  background: var(--input);
  border: 1px dashed var(--accent);
  border-radius: 14px;
}
.shorturl {
  display: block;
  font-family: var(--mono);
  font-size: clamp(17px, 5vw, 24px);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  word-break: break-all;
}
.shorturl:hover { color: var(--accent-2); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .btn.primary { grid-column: 1 / -1; min-height: 52px; font-size: 16px; }
.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.share-row > span { font-size: 13px; color: var(--muted); margin-right: 2px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
}
.chip:hover { border-color: var(--accent); }
.orig { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.orig-url { color: var(--muted); word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Recent */
.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recent-head .linkbtn { margin: 0; }
.recent-list { list-style: none; margin: 10px 0 0; padding: 0; }
.recent-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.recent-item:first-child { border-top: 0; }
.ri-main { min-width: 0; display: flex; flex-direction: column; }
.ri-short { font-family: var(--mono); font-weight: 700; font-size: 14.5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-short:hover { color: var(--accent-2); }
.ri-url { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Features */
.features { display: grid; gap: 12px; margin: 22px 0 4px; }
.feature { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.feature .fi { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; color: var(--accent-2); background: var(--glow); }
.feature h3 { font-size: 15px; margin-bottom: 2px; }
.feature p { font-size: 14px; color: var(--muted); }

.center-card { text-align: center; padding: 30px 20px; }
.center-card .big { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; color: var(--accent-2); background: var(--glow); }
.center-card p { margin: 8px 0 18px; color: var(--muted); }
.nf-code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--accent-2); margin-bottom: 8px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Admin */
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.admin-bar h1 { font-size: 24px; letter-spacing: -.02em; }
.admin-bar .bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { padding: 14px; text-align: center; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search .field { flex: 1; }
.rows { display: grid; gap: 10px; }
.row { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.row.off { opacity: .65; }
.row-short { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-family: var(--mono); font-weight: 700; font-size: 15px; text-decoration: none; word-break: break-all; }
.row-short b { color: var(--accent-2); }
.row-short:hover { text-decoration: underline; }
.row-url { margin-top: 3px; font-size: 13px; color: var(--muted); word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.row-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pill { padding: 2px 9px; font-size: 11.5px; font-weight: 700; border-radius: 999px; border: 1px solid var(--line); }
.pill.off { color: #ff6b76; border-color: rgba(229, 32, 46, .4); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-actions form { margin: 0; display: contents; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
details.card summary { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card[open] summary { margin-bottom: 14px; }
.form-grid { display: grid; gap: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }

@media (min-width: 640px) {
  .features { grid-template-columns: repeat(3, 1fr); }
  .feature { flex-direction: column; }
  .card { padding: 22px; }
  .actions { grid-template-columns: 1fr 1fr 1fr; }
  .actions .btn.primary { grid-column: auto; min-height: 48px; font-size: 15px; }
  .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .row-main { min-width: 0; flex: 1; }
  .row-actions { margin-top: 0; justify-content: flex-end; flex: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
