:root {
  --bg: #0e1117;
  --panel: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3fb950;
  --danger: #f85149;
}

* {
  box-sizing: border-box;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #222;
}

.page-header {
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-header p {
  margin: 8px 0 0 0;
}

.page-header img {
  width: 60px;
}

.page-header-details {
  display: flex;
  flex-direction: column;
  margin-left: 16px;
}

h1 {
  margin: 0;
  font-size: 1.2rem;
}

main {
  padding: 24px 0 0 0;
}

section {
  margin-bottom: 10px;
}

section h2 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 1rem;
}

.trades {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.trade {
  background: var(--panel);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  padding: 14px;
  border-left: 4px solid var(--accent);
  display: flex;
  flex-direction: column;
}

.trade:hover {
  background-color:#1a1f28
}

.trade .details {
    margin-top: auto;
}

.trade.sell {
  border-left-color: var(--danger);
}

.trade h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.trade .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.trade .details {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.amount {
  font-weight: 700;
  display: flex;
  align-items: center;
}

.timer-container {
  position: relative;
  width: 80px;
  height: 80px;
}

#countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.progress-ring__circle {
  stroke-dasharray: 213.6;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.2s linear;
}

.trade h3 a {
  color: var(--text);
  text-decoration: none;
}

.trade h3 a:hover {
  text-decoration: underline;
}

.last-updated {
  margin-bottom: 16px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.legend {
  background: var(--panel);
  border: 1px solid #222;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 18px;
}

.legend-title {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: var(--text);
}

.legend-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 700px) {
  .legend-items {
    grid-template-columns: 1fr 1fr;
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  border: 1px solid #999;
  font-family: 'Inter';
}

.legend-item.buy .badge {
  border-color: rgba(63, 185, 80, 0.6);
}

.legend-item.sell .badge {
  border-color: rgba(248, 81, 73, 0.6);
}

.legend-text {
  display: flex;
  color: var(--text);
  font-size: 0.85rem;
}

.legend-note {
  margin: 10px 0 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 650px) {
  #logo {
    width: 50px;
    margin-bottom: 4px;
    margin-right: 8px;
  }
  #page-supertitle {
    font-size: 1rem;
  }
  .page-header-details {
    margin-left: 5px;
    padding-left: none;
  }
}

.mute-btn {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  margin-bottom: 10px;
}

.mute-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.notice {
  background:#161b22;
  padding: 18px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.notice p {
  margin: 0;
}

.notice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.arrow {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.notice-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  max-height: fit-content;
  opacity: 1;
  margin-top: 10px;
  margin-right: 40px;
}

/* collapsed state */
.notice.collapsed .notice-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.notice.collapsed .arrow {
  transform: rotate(180deg); /* ▼ becomes ▲ */
}

#target {
  color: var(--muted);
}

.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip-icon {
  font-size: 1rem;
  color: var(--muted);
  cursor: help;
}

.tooltip {
  position: absolute;
  top: calc(100% + 10px); /* ⬇ force below */
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  background: rgb(25, 32, 46);
  border: 1px solid #222;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1000;
}


.tooltip-container:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(2px);
}

.trade-title {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
}

.trade-title a {
  color: var(--text);
  text-decoration: none;
}

.trade-title a:hover {
  text-decoration: underline;
}

.trade-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.3;
}

.trade-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 7px;
  font-family: 'Inter', SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

.trade-link {
  color: rgb(122, 183, 243) !important;
}

.profile-link {
  color: rgb(216, 183, 75);
  text-decoration: none;
  font-weight: 500;
}

.profile-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.trade-tx {
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.trade-tx a {
  color: var(--muted);
  text-decoration: none;
}

.trade-tx a:hover {
  color: var(--text);
  text-decoration: underline;
}

.status {
  color: var(--muted);
}

.section-title {
  color: white !important;
  margin-bottom: 16px;
}

.live-feed {
  border-bottom: 1px solid #222;
  padding-bottom: 10px;
  padding-top: 2px;
}

.trade-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.trade-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.trade-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.trade-subtitle strong {
  color: var(--text);
}

.trade {
  position: relative;
  background-color: var(--panel);
  overflow: hidden;
}

/* icon watermark */
.trade::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--trade-icon);
  background-repeat: no-repeat;
  background-position: right 18px bottom 50%;
  background-size: 56px;              /* ⬅ smaller */
  opacity: 1;                      /* ⬅ softer */
  filter: contrast(0.9);
  pointer-events: none;
}

/* fade-out mask so it never fights text */
.trade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at bottom right,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0.25) 30%,
    rgba(0,0,0,0.05) 55%,
    rgba(0,0,0,0) 70%
  );
  pointer-events: none;
}

/* ensure content stays above */
.trade > * {
  position: relative;
  z-index: 1;
}

.polling-control {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.polling-control select {
  background: #1b2430;
  color: #fff;
  border: 1px solid #2d3b4f;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 1rem;
}

.polling-note {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.polling-control label {
  font-size: 1rem;
}

.sample-ping {
  margin-top: 8px;
  background: #1b2430;
  color: #fff;
  border: 1px solid #2d3b4f;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}

.sample-ping:hover {
  background: #243246;
}

.sample-ping:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.preview-pings {
  margin-bottom: 16px;
}

.preview-pings button {
  font-size: 0.8rem;
}

.preview-pings button:nth-child(1) {
  margin-right: 8px;
}

@keyframes flash-twice {
  0%   { filter: brightness(1); }
  25%  { filter: brightness(4); }
  50%  { filter: brightness(1); }
  75%  { filter: brightness(4); }
  100% { filter: brightness(1); }
}

.flash-twice {
  animation: flash-twice 1s ease-in-out;
}

.history-container {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  margin-bottom: 6px;
}
.clear-history {
  margin-left: 10px;
  margin-top: 2px;
  background: #1b2430;
  color: #fff;
  border: 1px solid #2d3b4f;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  height: fit-content;
  cursor: pointer;
}

.clear-history:hover {
  background: #243246;
}
