:root {
  --bg: #000000;
  --blue: #2ea8ff;
  --blue-dim: #1b6cab;
  --grid-dot: rgba(46, 168, 255, 0.2);
  --text: #cfe8ff;
  --accent: #7fc7ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  height: 100%;
}

.header, .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(127, 199, 255, 0.15);
}

.footer {
  border-top: 1px solid rgba(127, 199, 255, 0.15);
  border-bottom: none;
  font-size: 12px;
  color: #93c9ff;
}

.title {
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
}

.price .label { color: #89c6ff; margin-right: 6px; }
.price .currency { margin-left: 6px; color: #66b6ff; }

.content { padding: 8px 16px; }

#chartContainer, #clockContainer {
  width: 100%;
  max-width: 1200px;
  height: 30vh;   /* smanjeno sa 40vh na 30vh */
  margin: 20px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

#kaspaChart, #ledClock {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(46, 168, 255, 0.08) inset;
  display: block;
}

#timezone {
  margin: 12px auto;
  background: var(--bg);
  color: var(--blue);
  border: 1px solid var(--blue);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  display: block;
}
/* omogućuje .grid-background da se pozicionira unutar ovih kontejnera */
#chartContainer, #clockContainer {
  position: relative;
}

/* osigurava točno 7 redova po cifri - konsolidirano */
.digit {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  width: 64px;
  height: 90px;
  padding: 6px;
  background: linear-gradient(180deg, rgba(46,168,255,0.02), rgba(46,168,255,0.01));
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(2,6,23,0.6);
}

/* pristupačnost: ukloni animacije za korisnike koji to žele */
@media (prefers-reduced-motion: reduce) {
  .pixel,
  #copyButton,
  #donation a {
    transition: none !important;
    animation: none !important;
  }
}
.grid-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 8px;
  background-image:
    radial-gradient(circle, var(--grid-dot) 1px, transparent 1px),
    radial-gradient(circle, var(--grid-dot) 1px, transparent 1px);
  background-position: 0 0, 20px 20px;
  background-size: 40px 40px;
  opacity: 0.85;
  mix-blend-mode: screen;
}

/* LED clock / pixel display */
.led-display {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
  font-family: 'Courier New', Courier, monospace;
  user-select: none;
}

/* Each digit is a grid of pixels (5 columns x 7 rows typical) */
/* `.digit` styles consolidated earlier */

/* Single pixel block */
.pixel {
  background: rgba(46,168,255,0.04);
  border-radius: 3px;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  will-change: background, box-shadow, transform;
}

/* Lit pixel */
.pixel.on {
  background: var(--blue);
  box-shadow: 0 0 8px rgba(46,168,255,0.9), 0 0 28px rgba(46,168,255,0.12) inset;
  transform: translateY(-1px);
}

/* Dim / inactive pixel subtle hover for interactivity/debug */
.pixel:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 6px rgba(46,168,255,0.06);
}

/* Colon separator */
.colon {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: 18px;
}
.colon .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(46,168,255,0.12);
}
.colon .dot.on {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(127,199,255,0.25);
}

/* Compact / responsive adjustments */
@media (max-width: 720px) {
  .digit { width: 46px; height: 66px; gap: 4px; }
  .led-display { gap: 8px; }
  #chartContainer, #clockContainer { height: 38vh; } /* more vertical room on small screens */
}

/* Accessibility helper */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Small decorative highlight for interactive regions */
.interactive-focus:focus,
.interactive-focus:focus-visible {
  outline: 2px dashed rgba(127,199,255,0.25);
  outline-offset: 4px;
  border-radius: 6px;
}

@media (max-width: 720px), (prefers-reduced-motion: reduce) {
  /* Reduce heavy visual effects on small screens or when motion is reduced */
  .digit { box-shadow: 0 2px 8px rgba(2,6,23,0.5); }
  .grid-background { opacity: 0.6; }
}
#donation {
  text-align: center;
  margin-top: 16px;
}

#donation a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--blue);
  padding: 8px 14px;
  border-radius: 6px;
  transition: 0.3s;
}

#donation a:hover {
  background: var(--blue);
  color: #000;
}

#donationQR {
  width: 100%;
  max-width: 300px;          /* širina okvira */
  margin: 20px auto;         /* centriranje */
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(46,168,255,0.08) inset;
  text-align: center;        /* centriraj sadržaj */
}

#donationQR img {
  width: 100%;               /* zauzima širinu okvira */
  height: auto;
  border: 2px solid var(--blue);
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(46,168,255,0.3);
}

#walletAddress {
  margin-top: 12px;
  font-size: 14px;
  color: var(--accent);
  word-break: break-all;
}

#copyButton {
  margin-top: 10px;
  padding: 6px 12px;
  border: 1px solid #2ea8ff;
  border-radius: 6px;
  background: #0a1f33;
  color: #2ea8ff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 0 12px rgba(46,168,255,0.4);
}

#copyButton:hover {
  background: #2ea8ff;
  color: #000;
  box-shadow: 0 0 20px rgba(46,168,255,0.8);
}

.hint { opacity: 0.7; }