body, html {
  padding: 0;
  margin: 0;
  height: 100%;
  color: white;
  background: url('bg.jpg') no-repeat center bottom black;
  background-size: cover;
  font-family: 'Oswald', sans-serif;
}

div.text {
  color: #a4d2fd;
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  text-shadow: 0 0 10px #000;
  text-rendering: optimizeLegibility !important;
  -webkit-font-smoothing: antialiased !important;
  font-size: 16px;
  z-index: 10;
}

a {
  color: white;
  cursor: pointer;
}

a.label {
  font-weight: bold;
  color: white;
}

div.marketcap {
  position: absolute;
  bottom: 88px;
  left: 50%;
  text-align: center;
  color: #a4d2fd;
  margin-left: -100px;
  text-shadow: 0 0 10px #000;
  text-rendering: optimizeLegibility !important;
  -webkit-font-smoothing: antialiased !important;
}

.marketcap:before {
    content: "Total Market Cap: ";
    color: white;
}

nav {
  position: absolute;
  color: #a4d2fd;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

nav > * {
  cursor: pointer;
  opacity: 0.5;
  pointer-events: auto;
}

nav > *:hover {
  opacity: 1;
}

nav .help {
  right: 10px;
  top: 10px;
  position: absolute;
  font-size: 36px;
}

nav .right, nav .left {
  position: absolute;
  top: 50%;
  left: 0;
  font-size: 48px;
  display: none;
  margin-top: -24px;
}

nav .right {
  left: auto;
  right: 0;
}

div.overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  max-height: 100%;
  padding: 50px;
  max-width: 100%;
  box-sizing: border-box;
}

div.overlay .box {
  display: inline-block;
  text-align: center;
  padding: 20px;
  background: rgba(0,0,0,0.75);
  height: auto;
  border-radius: 10px;
  cursor: default;
  text-shadow: 0 0 10px #000;
  text-rendering: optimizeLegibility !important;
  -webkit-font-smoothing: antialiased !important;
  overflow: auto;
  max-height: 100%;
  max-width: 100%;
}

div.overlay .box b {
  color: gold;
  cursor: text;
}

div.overlay .donation {
  display: none;
}

div.overlay .donation img {
  margin: 10px;
}

span.price {
  display: block;
  color: gold;
}

span.stats {
  white-space: pre;
  text-align: right;
  z-index: 10;
  float: right;
  position: relative;
}

div.currencies {
  display: flex;
  height: 100%;
}

div.currencies > div {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 10px;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.5);
  background: no-repeat center center;
  background-size: 80% auto;
}

div.currencies canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

@media screen and (max-width: 1100px) {
  div.currencies > div:nth-child(4) {
    display: none;
  }
  nav .left, nav .right {
    display: block;
  }
}

@media screen and (max-width: 800px) {
  div.currencies > div:nth-child(3) {
    display: none;
  }
}

@media screen and (max-width: 550px) {
  div.currencies > div:nth-child(2) {
    display: none;
  }
}





span.coin-marketcap {
  display: block;
  color: #a4d2fd;
  font-size: 14px;
  margin-bottom: 5px;
}

span.coin-marketcap:not(:empty)::before {
  content: "Market Cap: ";
  color: white;
}


/* SUM LOGO START */
div.currencies > div.sum {
  background-image: none !important;
}

div.currencies > div.sum::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('img/sum2.png') no-repeat center center;
  background-size: 72% auto;
  opacity: 0.18;
  filter: grayscale(1) brightness(0.65);
  pointer-events: none;
  z-index: 0;
}

div.currencies canvas {
  z-index: 1;
}
/* SUM LOGO END */

/* === CLEAN THREE-LANE FOOTER === */

div.text {
  display: grid !important;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "market stats"
    "label  stats"
    "price  stats"
    "donate stats";
  column-gap: 14px;
  row-gap: 2px;
  align-items: end;
  bottom: 12px;
  left: 14px;
  right: 14px;
}

div.text .coin-marketcap {
  grid-area: market;
  margin: 0 0 3px 0;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

div.text .stats {
  grid-area: stats;
  float: none !important;
  position: static !important;
  text-align: right;
  white-space: pre;
  line-height: 1.35;
  font-size: 15px;
  align-self: end;
  justify-self: end;
}

div.text .label {
  grid-area: label;
  justify-self: start;
}

div.text .price {
  grid-area: price;
  justify-self: start;
}

div.text .donate {
  grid-area: donate;
  justify-self: start;
}

div.marketcap {
  top: 14px !important;
  bottom: auto !important;
  left: 50% !important;
  margin-left: 0 !important;
  transform: translateX(-50%);
  z-index: 20;
  white-space: nowrap;
  font-size: 14px;
}

/* Better SUM background treatment */
div.currencies > div.sum::before {
  background-size: 68% auto !important;
  opacity: 0.16 !important;
  filter: grayscale(1) sepia(.25) hue-rotate(215deg) saturate(1.6) brightness(.7) !important;
}

@media screen and (max-width: 800px) {
  div.text {
    grid-template-columns: 1fr;
    grid-template-areas:
      "market"
      "stats"
      "label"
      "price"
      "donate";
  }

  div.text .stats {
    text-align: left;
    justify-self: start;
  }

  div.marketcap {
    font-size: 12px;
  }
}


/* === FINAL SUM ARTWORK === */

div.currencies > div.sum::before {
  background-image: url('img/sum-official.png') !important;
  background-size: 72% auto !important;
  opacity: 0.18 !important;
  filter: grayscale(1) brightness(.75) !important;
}


/* === RESPONSIVE: ONE LANE WHEN SPACE IS TIGHT === */

@media screen and (max-width: 1100px) {

  div.currencies > div {
    display: none !important;
    width: 100% !important;
  }

  div.currencies > div:first-child {
    display: block !important;
  }

  nav .left,
  nav .right {
    display: block !important;
  }

  div.text {
    left: 18px !important;
    right: 18px !important;
  }
}


/* === SUMCOIN OFFICIAL LOGO === */

div.currencies > div.sum::before {
  background-image: url('img/sum-official.png') !important;
  background-size: 72% auto !important;
  opacity: 0.18 !important;
  filter: grayscale(1) brightness(.72) !important;
}


/* === SUMCOIN DONATION QR === */

.qr-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 12px auto;
}

.qr-wrap .qr-code {
  display: block;
  width: 300px;
  height: 300px;
  background: #fff;
}

.qr-logo-bg {
  position: absolute;
  width: 68px;
  height: 68px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-wrap .qr-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: block;
}

.open-wallet {
  display: inline-block;
  margin: 7px 0 10px;
  padding: 9px 16px;
  border: 1px solid #ffd800;
  border-radius: 5px;
  color: #ffd800 !important;
  text-decoration: none;
}

.open-wallet:hover {
  background: #ffd800;
  color: #111 !important;
}


.wallet-downloads {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}

.wallet-downloads a {
  display: inline-block;
  padding: 8px 13px;
  border: 1px solid gold;
  border-radius: 5px;
  color: gold;
  text-decoration: none;
}

.wallet-downloads a:hover {
  background: gold;
  color: #111;
}

/* Keep ONLY the QR in the big square */
.qr-wrap .qr-code {
  margin: 0 !important;
}

/* Actual Sumcoin logo centered above QR modules */
.qr-wrap .qr-logo {
  width: 58px !important;
  height: 58px !important;
  margin: 0 !important;
  object-fit: contain;
}

.qr-logo-bg {
  z-index: 5;
}
