/* Monni — deliberate Million Dollar Homepage homage. Flat, light, editorial. */
:root {
  --paper: #f7f4ec;
  --ink: #111111;
  --mute: #444444;
  --rule: #111111;
  --link: #0000cc;
  --link-visited: #551a8b;
  --warn: #7a1f1f;
  --ok: #0b4d0b;
  --panel: #ffffff;
  --stripe: #efe9d8;
  --select: rgba(0, 0, 180, 0.28);
  --serif: "Times New Roman", Times, Georgia, serif;
  --mono: "Courier New", Courier, ui-monospace, monospace;
  --sans: Verdana, Geneva, Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  max-width: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}
a { color: var(--link); }
a:visited { color: var(--link-visited); }

/* —— Top bar (MDH-like) —— */
.topbar {
  border-bottom: 3px solid var(--rule);
  background: var(--panel);
  padding: 10px 16px 8px;
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
}
.masthead {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}
.masthead span {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--mute);
  display: block;
  margin-top: 2px;
}
.lang a {
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  margin-left: 10px;
  color: var(--mute);
  border-bottom: 1px dotted transparent;
}
.lang a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 700;
}

/* —— Tagline + stats strip —— */
.strip {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #bbb;
}
.tagline {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 10px;
  max-width: 52em;
}
.tagline strong { font-weight: 700; }
.stats {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--stripe);
  border: 1px solid var(--rule);
}
.stats td {
  border-right: 1px solid var(--rule);
  padding: 8px 10px;
  vertical-align: top;
}
.stats td:last-child { border-right: 0; }
.stats .k { color: var(--mute); display: block; margin-bottom: 2px; }
.stats .v { font-size: 16px; font-weight: 700; }
.meter {
  margin-top: 8px;
  border: 1px solid var(--rule);
  height: 12px;
  background: #fff;
  position: relative;
}
.meter > i {
  display: block;
  height: 100%;
  width: 0;
  background: #111;
}
.meter-caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  margin: 4px 0 0;
}

/* —— Wall hero —— */
.wall-hero {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px 8px;
  text-align: center;
}
.wall-hero h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 700;
}
.wall-hero .sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  margin: 0 0 12px;
}
.wall-frame {
  display: block;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  border: 4px solid #111;
  background: #ddd;
  padding: 0;
  line-height: 0;
  box-shadow: 6px 6px 0 #00000022;
  overflow: hidden;
}
#wall {
  display: block;
  width: 100%;
  max-width: 1000px;
  height: auto;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none;
  background-color: #e8e8e8;
  background-image:
    linear-gradient(#ccc 1px, transparent 1px),
    linear-gradient(90deg, #ccc 1px, transparent 1px);
  background-size: 1% 1%; /* 100 blocks across, scales with CSS size */
}
.wall-tools {
  margin: 10px auto 0;
  max-width: 1000px;
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
}
.wall-tools .sel { color: var(--mute); margin-left: 12px; }

/* —— Buy form —— */
.buy {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}
.buy h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 16px 0 8px;
  border-bottom: 2px solid #111;
  padding-bottom: 4px;
}
.buy-grid {
  display: table;
  width: 100%;
  border-collapse: collapse;
}
.buy-grid .col {
  display: table-cell;
  width: 50%;
  vertical-align: top;
  padding-right: 20px;
}
.buy-grid .col + .col { padding-right: 0; padding-left: 20px; border-left: 1px solid #bbb; }
@media (max-width: 800px) {
  .buy-grid, .buy-grid .col { display: block; width: 100%; }
  .buy-grid .col + .col { border-left: 0; padding-left: 0; margin-top: 16px; }
}
label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 0 3px;
  color: var(--mute);
}
input[type="text"],
input[type="url"],
input[type="file"],
textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid #111;
  background: #fff;
  padding: 6px 8px;
  border-radius: 0;
  color: var(--ink);
}
input[type="color"] {
  width: 64px;
  height: 28px;
  border: 1px solid #111;
  padding: 0;
  background: #fff;
  border-radius: 0;
}
textarea { min-height: 96px; resize: vertical; }

button, .btn {
  font-family: var(--mono);
  font-size: 13px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  padding: 6px 12px;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 2px 2px 0 #111;
}
button:hover, .btn:hover { background: #111; color: #fff; }
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
button.primary {
  background: #ffe566;
  font-weight: 700;
}
button.primary:hover { background: #111; color: #ffe566; }
.msg {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 8px 0;
}
.msg.ok { color: var(--ok); }
.msg.err { color: var(--warn); }

/* —— Below-the-fold editorial —— */
.below {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 16px 48px;
  border-top: 3px double #111;
}
.below h2 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 28px 0 8px;
}
.columns {
  display: table;
  width: 100%;
  border-collapse: collapse;
}
.columns .c {
  display: table-cell;
  width: 50%;
  vertical-align: top;
  padding-right: 24px;
}
.columns .c + .c { padding-right: 0; padding-left: 24px; border-left: 1px solid #bbb; }
@media (max-width: 800px) {
  .columns, .columns .c { display: block; width: 100%; }
  .columns .c + .c { border-left: 0; padding-left: 0; margin-top: 20px; }
}
.rule {
  font-size: 13px;
  color: var(--mute);
  margin: 0 0 10px;
  max-width: 40em;
}
.tip-row {
  display: table;
  width: 100%;
  margin-top: 8px;
}
.tip-row .qr,
.tip-row .addr {
  display: table-cell;
  vertical-align: middle;
}
.tip-row .qr { width: 140px; padding-right: 16px; }
.tip-row img {
  width: 120px;
  height: 120px;
  border: 1px solid #111;
  background: #fff;
  display: block;
}
.wallet, .mono-wrap, code.mono-wrap {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
  overflow-wrap: anywhere;
  border: 1px solid #111;
  background: #fff;
  padding: 8px;
  display: block;
}
code.mono-wrap { display: inline; border: 0; padding: 0; background: transparent; }
.addr-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.addr-row .wallet { flex: 1 1 200px; min-width: 0; }
input.mono-long {
  overflow-x: auto;
  text-overflow: ellipsis;
}
.disclosure {
  margin-top: 28px;
  padding: 12px;
  border: 1px solid #111;
  background: var(--stripe);
  font-size: 12px;
  color: var(--mute);
  max-width: 70em;
}
.preview {
  max-width: 100%;
  border: 1px solid #111;
  margin-top: 10px;
  display: block;
}
#swarm-out {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid #111;
  background: #fff;
  padding: 8px;
  max-height: 240px;
  overflow: auto;
  margin: 8px 0 0;
}
footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px 40px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}


/* i18n */
.i18n-it { display: none !important; }
html[lang="it"] .i18n-en { display: none !important; }
html[lang="it"] span.i18n-it { display: inline !important; }
html[lang="it"] p.i18n-it,
html[lang="it"] h2.i18n-it,
html[lang="it"] h3.i18n-it,
html[lang="it"] label.i18n-it,
html[lang="it"] div.i18n-it,
html[lang="it"] .masthead span.i18n-it { display: block !important; }


/* —— Mobile / narrow (desktop look unchanged above) —— */
@media (max-width: 800px) {
  .topbar { padding: 10px 12px 8px; }
  .masthead { font-size: 24px; }
  .strip, .wall-hero, .buy, .below, footer { padding-left: 12px; padding-right: 12px; }
  .tagline { font-size: 15px; }
  .stats { display: block; width: 100%; }
  .stats tbody, .stats tr { display: block; width: 100%; }
  .stats tr {
    display: flex;
    flex-wrap: wrap;
  }
  .stats td {
    flex: 1 1 46%;
    min-width: 140px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    box-sizing: border-box;
  }
  .stats td:nth-child(odd) { border-right: 1px solid var(--rule); }
  .stats td:nth-last-child(-n+2) { border-bottom: 0; }
  .wall-hero .sub { font-size: 11px; overflow-wrap: anywhere; }
  .wall-frame { box-shadow: 3px 3px 0 #00000022; border-width: 3px; }
  .wall-tools { max-width: 100%; }
  .wall-tools .sel { display: inline-block; margin-left: 0; margin-top: 6px; }
  .tip-row, .tip-row .qr, .tip-row .addr { display: block; width: 100%; }
  .tip-row .qr { width: auto; padding-right: 0; margin-bottom: 12px; }
  .tip-row img {
    width: min(160px, 42vw);
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .rule code, .disclosure code { word-break: break-all; overflow-wrap: anywhere; }
  #swarm-out { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 430px) {
  .stats td {
    flex: 1 1 100%;
    min-width: 0;
    border-right: 0 !important;
    border-bottom: 1px solid var(--rule);
  }
  .stats td:last-child { border-bottom: 0; }
  .masthead { font-size: 22px; }
  button, .btn { max-width: 100%; }
}

