﻿:root {
  --bg: #12061f;
  --bg-accent: #1d0d2f;
  --card-bg: #1f1233;
  --accent: #a855f7;
  --accent-strong: #9333ea;
  --accent-soft: rgba(168, 85, 247, 0.14);
  --text: #efe9f9;
  --muted: #b8a4d6;
  --danger-soft: rgba(251, 113, 133, 0.18);
  --danger-border: rgba(251, 113, 133, 0.32);
  --danger-text: #fda4af;
}

* {
  box-sizing: border-box;
}
.box-cont{
  align-items: center;
}
.mini-image {
  max-height: 34px;
  margin-right: 15px;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, var(--bg-accent), var(--bg));
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

body.modal-open {
  overflow: hidden;
}

main {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  display: grid;
  gap: 2rem;
}

.results-layout {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2rem;
  width: min(1200px, 100%);
}

.results-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 2.25rem 2rem;
  background: var(--card-bg);
  border-radius: 24px;
  border: 1px solid #39215f;
  box-shadow: 0 24px 58px rgba(17, 8, 26, 0.45);
  min-width: 240px;
  max-width: 280px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.sidebar-subtitle {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.sidebar-note {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
}

.sidebar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.2rem;
  border-radius: 18px;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  border: none;
  color: #140725;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sidebar-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #140725;
  box-shadow: 0 16px 32px rgba(147, 51, 234, 0.28);
}

.sidebar-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.announce-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.announce-list-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.announce-list-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.announce-list-name {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.announce-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.announce-list-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.announce-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.announce-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.announce-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #140725;
  font-weight: 600;
  font-size: 0.7rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.announce-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(147, 51, 234, 0.22);
}

.announce-empty {
  font-size: 0.8rem;
  color: var(--text);
}

.card {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-radius: 26px;
  padding: 2.75rem;
  box-shadow: 0 28px 70px rgba(17, 8, 26, 0.55);
  border: 1px solid #39215f;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--accent);
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
  max-width: 56ch;
}

.form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.form input {
  flex: 1 1 280px;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(184, 164, 214, 0.28);
  background: rgba(17, 8, 26, 0.65);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.form button {
  padding: 0.9rem 1.6rem;
  border: none;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #140725;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(147, 51, 234, 0.35);
}

.summary-table {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr repeat(2, minmax(140px, 180px));
  align-items: center;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: #291845;
  border: 1px solid #39215f;
  gap: 2rem; /* Increased gap for more spacing */
}

.summary-row .col-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 1100px) {
  .results-layout {
    flex-direction: column;
    align-items: center;
    max-width: min(940px, 100%);
  }

  .results-sidebar {
    min-width: 0;
    width: 100%;
    max-width: min(420px, 100%);
  }
}

.summary-row .col-fees,
.summary-row .col-volume {
  justify-self: flex-end;
  font-weight: 600;
}

.summary-header {
  background: var(--accent-soft);
  border-color: rgba(168, 85, 247, 0.26);
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.summary-art {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.summary-art img {
  width: clamp(120px, 20vw, 180px);
  height: auto;
  filter: drop-shadow(0 14px 28px rgba(10, 4, 20, 0.45));
}

.summary-total .col-name {
  font-size: 1.1rem;
  letter-spacing: 0.14em;
}

.summary-total .col-fees,
.summary-total .col-volume {
  font-size: clamp(1.2rem, 1.4vw, 1.6rem); /* Reduced font size */
  font-weight: 700;
}

.summary-total .col-fees {
  margin-left: auto; /* Pushes values to the right */
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem; /* Added margin-top */
}

.share-button {
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #140725;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.share-button:not([disabled]):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(147, 51, 234, 0.35);
}

.share-card {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 640px;
  padding: 2.4rem;
  border-radius: 28px;
  background: radial-gradient(circle at top left, rgba(168, 85, 247, 0.28), rgba(18, 6, 31, 0.95));
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: var(--text);
  display: grid;
  gap: 1.5rem;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.share-card-header { /* Modified for image placement */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-card-header-text {
  display: grid;
  gap: 0.4rem;
}

.share-card-sticker {
  width: clamp(88px, 12vw, 128px);
  /* Removed align-self, justify-self, margin-top */
  margin-left: auto; /* Pushes image to the right */
  filter: drop-shadow(0 12px 22px rgba(10, 4, 20, 0.55));
}

.share-card-logo {
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.share-card-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.share-card-caption {
  margin: 0;
  color: rgba(239, 233, 249, 0.74);
  font-size: 1rem;
}

.share-card-body {
  display: grid;
  gap: 0.85rem;
}

.share-card-row {
  display: grid;
  grid-template-columns: 1fr repeat(2, minmax(140px, 1fr));
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  background: rgba(17, 8, 26, 0.55);
  border: 1px solid rgba(184, 164, 214, 0.16);
  gap: 1rem;
}

.share-card.mode-fees .share-card-row,
.share-card.mode-volume .share-card-row {
  grid-template-columns: 1fr minmax(140px, 1fr);
}

.share-card.mode-both .share-card-row {
  grid-template-columns: 1fr repeat(2, minmax(140px, 1fr));
}

.share-card-row .name {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.share-card-row .fees,
.share-card-row .volume {
  justify-self: flex-end;
  font-weight: 600;
}

.share-card-footer {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: rgba(17, 8, 26, 0.5);
  border: 1px solid rgba(184, 164, 214, 0.2);
  border-radius: 18px;
  padding: 1.1rem 1.4rem;
}

.share-card.mode-fees .share-card-footer,
.share-card.mode-volume .share-card-footer {
  justify-content: flex-end; /* Align single total to the right */
}

.share-card.mode-both .share-card-footer {
  justify-content: space-between; /* Keep space-between for both totals */
}

.share-card-total {
  display: grid;
  gap: 0.25rem;
  /* Removed flex-grow: 1; */
}

.share-card-total-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: rgba(239, 233, 249, 0.66);
}

.share-card-total-value {
  font-size: 1.3rem;
  font-weight: 700;
}

.share-card-meta {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.7rem;
  color: rgba(239, 233, 249, 0.5);
}
.share-card-meta-under {
  letter-spacing: 0.24em;
  font-size: 0.7rem;
  color: rgba(239, 233, 249, 0.5);
}

.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 11, 0.78);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 20;
}

.share-modal[hidden] {
  display: none;
}

.share-modal-content {
  position: relative;
  width: min(600px, 100%);
  background: rgba(20, 10, 32, 0.96);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 24px;
  box-shadow: 0 40px 80px rgba(6, 3, 11, 0.65);
  padding: 2rem;
  display: grid;
  gap: 1.25rem;
}

.share-modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.share-modal-close:hover {
  color: var(--accent);
}

.share-modal-subtitle {
  margin: 0;
  color: var(--muted);
}

.share-modal-preview {
  background: rgba(17, 8, 26, 0.65);
  border-radius: 20px;
  border: 1px solid rgba(184, 164, 214, 0.16);
  padding: 1rem;
  max-width: min(520px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: center;
}


.share-modal-preview img {
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.share-modal-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #140725;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-modal-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(147, 51, 234, 0.35);
}

.alert {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  padding: 1rem 1.2rem;
  border-radius: 16px;
  color: var(--danger-text);
  font-size: 0.95rem;
  margin-top: 2rem;
}

.loader {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.loader::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

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

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.footer-wh {
  color: white;
}
@media (max-width: 700px) {
  .card {
    padding: 2rem;
  }

  .results-sidebar {
    padding: 1.75rem 1.5rem;
    gap: 0.85rem;
  }

  .sidebar-button {
    width: 100%;
  }

  .summary-header {
    display: none;
  }

  .summary-row {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 0.75rem;
    background: #291845;
    border: 1px solid #39215f;
  }

  .summary-row:not(.summary-header) {
    padding: 0.9rem 1.05rem;
  }

  .summary-row .col-name {
    font-size: 1rem;
  }

  .summary-row .col-fees,
  .summary-row .col-volume {
    justify-self: stretch;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: #2f1c4c;
    font-size: 0.95rem;
  }

  .summary-row:not(.summary-header) .col-fees::before,
  .summary-row:not(.summary-header) .col-volume::before {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
  }

  .summary-row:not(.summary-header) .col-fees::before {
    content: 'Total fees';
  }

  .summary-row:not(.summary-header) .col-volume::before {
    content: 'Total volume';
  }

  .summary-total .col-fees {
    margin-left: 0;
  }

  .share-actions {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .share-actions .share-button {
    width: 100%;
  }

  .share-modal-content {
    padding: 1.75rem;
  }
}

@media (max-width: 640px) {
  .form {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  body {
    padding: 1.5rem 1rem;
    align-items: flex-start;
  }

  main {
    gap: 1.5rem;
  }

  .card {
    padding: 1.5rem;
    border-radius: 22px;
  }

  .header {
    gap: 0.75rem;
  }

  .page-title {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .form {
    gap: 0.65rem;
  }

  .form input {
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    border-radius: 14px;
    line-height: 1.2;
    max-height: 46px;
  }

  .form input,
  .form button {
    width: 100%;
  }

  .form button {
    padding: 0.85rem 1.4rem;
    font-size: 0.95rem;
  }

  .mini-image {
    max-height: 28px;
    margin-right: 10px;
  }

  .summary-table {
    margin-top: 1.5rem;
    gap: 0.65rem;
  }

  .summary-row {
    padding: 0.85rem 1rem;
    gap: 1rem;
  }

  .summary-row .col-name,
  .summary-row .col-fees,
  .summary-row .col-volume {
    font-size: 0.95rem;
  }

  .share-actions {
    width: 100%;
    gap: 0.65rem;
  }

  .share-modal {
    padding: 1rem;
  }

  .share-modal-content {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .share-modal-download {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer span,
  .footer a {
    font-size: 0.85rem;
  }
}

.background-stack {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.background-sticker {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: clamp(200px, 22vw, 300px);
  opacity: 0.2;
  transform: translate(-50%, -50%) rotate(var(--rotate)) scale(var(--scale));
  filter: brightness(0.35) saturate(0.6);
  mix-blend-mode: multiply;
  animation: backgroundFloat var(--duration) ease-in-out infinite alternate;
}

@keyframes backgroundFloat {
  from {
    transform: translate(-50%, -50%) rotate(calc(var(--rotate) - 4deg)) scale(var(--scale));
  }
  to {
    transform: translate(-50%, -50%) rotate(calc(var(--rotate) + 4deg)) scale(calc(var(--scale) * 1.05));
  }
}
