/* ═══════════════════════════════════════════════════════
   BLOCKCITY — style.css  |  Blue/Cyan Matrix Theme
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&family=Exo+2:wght@300;400;600&display=swap');

:root {
  --bg:         #0a0a12;
  --surface:    #0f0f1a;
  --card:       #13131f;
  --border:     #1e1e32;
  --border-lit: #2e2e50;

  /* Room accent colours — dark vibrant + pastel mix */
  --r1: #60A5FA;   /* soft blue       — Room 1 Foundation */
  --r2: #4ADE80;   /* vivid green     — Room 2 Token      */
  --r3: #F472B6;   /* hot pink        — Room 3 Identity   */
  --r4: #FB923C;   /* burnt orange    — Room 4 Council    */
  --r5: #A78BFA;   /* lavender violet — Room 5 Guestbook  */

  --white:  #F1F0FF;
  --text:   #9494B8;
  --muted:  #3A3A5C;
  --danger: #FF4D6D;

  --font-display: 'Orbitron', monospace;
  --font-mono:    'Share Tech Mono', monospace;
  --font-body:    'Exo 2', sans-serif;

  --radius: 12px;

  --glow-r1: 0 0 24px rgba(96,165,250,0.35);
  --glow-r2: 0 0 24px rgba(74,222,128,0.35);
  --glow-r3: 0 0 24px rgba(244,114,182,0.35);
  --glow-r4: 0 0 24px rgba(251,146,60,0.35);
  --glow-r5: 0 0 24px rgba(167,139,250,0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════
   CANVAS + BACKGROUND
══════════════════════════════════════════════════════ */
#blockchainCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
}

/* Matrix rain grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridPulse 6s ease-in-out infinite alternate;
}
@keyframes gridPulse { 0%{opacity:.3} 100%{opacity:1} }

/* Cyan radial glow top */
body::after {
  content: "";
  position: fixed;
  top: -200px; left: 50%; transform: translateX(-50%);
  width: 1000px; height: 600px;
  background: radial-gradient(ellipse, rgba(0,212,255,0.06) 0%, transparent 70%);
  z-index: 1;
  pointer-events: none;
}

/* Scanlines */
body {
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

.topbar, .container,
.hero, .modules,
.txlog {
  position: relative;
  z-index: 2;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 0 1.5rem;
}

/* ══════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(1,10,15,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-lit);
  box-shadow: 0 1px 30px rgba(0,212,255,0.08);
  z-index: 100;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 62px;
  padding: 0 1.5rem;
  max-width: 1100px;
  margin: auto;
}

.topbar-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: .2em;
  color: var(--r1);
  display: flex;
  align-items: center;
  gap: .55rem;
  text-shadow: 0 0 20px rgba(0,212,255,0.6);
}
.logo-sub {
  color: var(--muted);
  font-size: .7rem;
  font-family: var(--font-mono);
  letter-spacing: .12em;
}
.logo-chain { display: flex; align-items: center; gap: 3px; }
.lc-block   { display: block; width: 9px; border-radius: 2px; animation: lcPulse 2.4s ease-in-out infinite; }
.lc-link    { display: block; width: 5px; height: 1px; background: var(--border-lit); }
.lc1 { height: 9px;  background: var(--r1); animation-delay: 0s;   }
.lc2 { height: 12px; background: var(--r3); animation-delay: .4s;  }
.lc3 { height: 7px;  background: var(--r2); animation-delay: .8s;  }
@keyframes lcPulse {
  0%,100% { opacity:.5; transform:scaleY(1); }
  50%      { opacity:1;  transform:scaleY(1.4); box-shadow: 0 0 8px currentColor; }
}

.topbar-right { display: flex; align-items: center; gap: .9rem; }

.nav-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  transition: border-color .3s, box-shadow .3s;
}
.nav-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--muted);
  transition: background .3s, box-shadow .3s;
}
.nav-dot.active               { animation: dotPulse 2s infinite; }
#nav-r1.active { background: var(--r1); box-shadow: 0 0 12px var(--r1); }
#nav-r2.active { background: var(--r2); box-shadow: 0 0 12px var(--r2); }
#nav-r3.active { background: var(--r3); box-shadow: 0 0 12px var(--r3); }
#nav-r4.active { background: var(--r4); box-shadow: 0 0 12px var(--r4); }
@keyframes dotPulse { 0%,100%{opacity:1} 50%{opacity:.25} }

.nav-progress.complete {
  border-color: var(--r5);
  animation: completePulse 3s infinite;
}
@keyframes completePulse {
  0%,100% { box-shadow: 0 0 12px rgba(0,255,204,.3); }
  50%      { box-shadow: 0 0 30px rgba(0,255,204,.6); }
}
.nav-label {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--muted);
  letter-spacing: .1em;
  margin-left: 4px;
}

#connectBtn {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  padding: .5rem 1.1rem;
  background: transparent;
  border: 1px solid var(--r1);
  color: var(--r1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .22s;
  text-transform: uppercase;
}
#connectBtn:hover           { background: var(--r1); color: var(--bg); box-shadow: var(--glow-cyan); }
#connectBtn.connected       { border-color: var(--r2); color: var(--r2); }
#connectBtn.connected:hover { background: var(--r2); color: var(--bg); }

/* ══════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════ */
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border-lit);
  position: relative;
  overflow: hidden;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.eyebrow-line { flex: 1; max-width: 60px; height: 1px; background: var(--border-lit); }

.hero-blocks-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hb {
  position: absolute;
  font-family: var(--font-mono);
  font-size: .5rem;
  padding: 3px 7px;
  border: 1px solid;
  border-radius: 3px;
  opacity: 0;
  animation: hbFloat 7s ease-in-out infinite;
}
.hb1 { color:var(--r1); border-color:var(--r1); top:15%; left:4%;  animation-duration:8s; animation-delay:0s;   }
.hb2 { color:var(--r2); border-color:var(--r2); top:22%; right:5%; animation-duration:7s; animation-delay:1s;   }
.hb3 { color:var(--r4); border-color:var(--r4); top:60%; left:7%;  animation-duration:9s; animation-delay:2.5s; }
.hb4 { color:var(--r3); border-color:var(--r3); top:68%; right:9%; animation-duration:6s; animation-delay:.8s;  }
.hb5 { color:var(--r5); border-color:var(--r5); top:78%; left:14%; animation-duration:8s; animation-delay:3.5s; }
.hb6 { color:var(--r2); border-color:var(--r2); top:38%; right:3%; animation-duration:7s; animation-delay:1.8s; }
@keyframes hbFloat {
  0%   { opacity:0; transform:translateY(12px); }
  20%  { opacity:.5; }
  80%  { opacity:.2; }
  100% { opacity:0; transform:translateY(-22px); }
}

.hero-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  letter-spacing: .12em;
  line-height: .95;
  color: var(--white);
  margin-bottom: .8rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
  text-shadow: 0 0 40px rgba(0,212,255,0.3);
}
.hero-title .accent {
  background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chain-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.8rem auto 1.6rem;
  max-width: 600px;
}
.chain-node {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 34px;
  border: 1px solid;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: .58rem;
  font-weight: 500;
  letter-spacing: .08em;
  flex-shrink: 0;
  animation: nodeGlow 3s ease-in-out infinite;
}
.cn1 { color:var(--r1); border-color:var(--r1); background:rgba(0,212,255,.05); animation-delay:0s;   }
.cn2 { color:var(--r2); border-color:var(--r2); background:rgba(0,255,159,.05); animation-delay:.5s;  }
.cn3 { color:var(--r3); border-color:var(--r3); background:rgba(123,97,255,.05); animation-delay:1s;  }
.cn4 { color:var(--r4); border-color:var(--r4); background:rgba(255,107,53,.05); animation-delay:1.5s;}
.cn5 { color:var(--r5); border-color:var(--r5); background:rgba(0,255,204,.05);  animation-delay:2s;  }
@keyframes nodeGlow { 0%,100%{opacity:.6;box-shadow:none} 50%{opacity:1;box-shadow:0 0 16px currentColor} }

.chain-wire {
  flex: 1;
  height: 1px;
  background: var(--border-lit);
  position: relative;
  overflow: hidden;
  min-width: 10px;
  max-width: 30px;
}
.chain-wire::after {
  content: '';
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 8px; height: 3px;
  border-radius: 2px;
  background: var(--r1);
  opacity: .9;
  animation: packetMove 2s linear infinite;
}
.chain-row .chain-wire:nth-child(4)::after  { animation-delay: .5s;  background: var(--r2); }
.chain-row .chain-wire:nth-child(6)::after  { animation-delay: 1s;   background: var(--r3); }
.chain-row .chain-wire:nth-child(8)::after  { animation-delay: 1.5s; background: var(--r4); }
.chain-row .chain-wire:nth-child(10)::after { animation-delay: 2s;   background: var(--r5); }
@keyframes packetMove {
  0%   { left:-8px; opacity:0; }
  20%  { opacity:1; }
  80%  { opacity:1; }
  100% { left:100%; opacity:0; }
}

.hero-sub {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .08em;
  margin-top: .5rem;
  margin-bottom: 2rem;
}

.wallet-bar {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  padding: .7rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-lit);
  border-radius: 30px;
  flex-wrap: wrap;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0,212,255,0.05);
}
.wstat       { display:flex; align-items:center; gap:.5rem; font-family:var(--font-mono); font-size:.68rem; }
.wstat-label { color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: .6rem; }
.wstat-value { color: var(--r1); text-shadow: 0 0 10px rgba(0,212,255,0.4); }
.wdivider    { width: 1px; height: 16px; background: var(--border-lit); }

/* ══════════════════════════════════════════════════════
   MODULE GRID
══════════════════════════════════════════════════════ */
.modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 3rem 0 2rem;
}
@media (max-width:720px) { .modules { grid-template-columns: 1fr; } }

.module {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  position: relative;
}
.module::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  background: radial-gradient(ellipse at top, rgba(0,212,255,0.03), transparent 60%);
}
.module:hover {
  transform: translateY(-4px);
  border-color: var(--border-lit);
  box-shadow: 0 20px 50px rgba(0,0,0,.6), 0 0 30px rgba(0,212,255,0.06);
}
.module:hover::before { opacity: 1; }

.module-accent { height: 2px; background: var(--accent, var(--r1)); box-shadow: 0 0 12px var(--accent, var(--r1)); }

.module-header {
  padding: 1.4rem 1.4rem 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.module-icon  { font-size: 1.8rem; line-height: 1; margin-bottom: .4rem; filter: drop-shadow(0 0 8px rgba(0,212,255,0.4)); }
.module-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: .1em;
  color: var(--white);
  margin-bottom: .2rem;
  text-shadow: 0 0 20px rgba(0,212,255,0.2);
}
.module-desc  { font-size: .75rem; color: var(--muted); line-height: 1.5; }
.module-tag {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--accent, var(--r1));
  border: 1px solid var(--accent, var(--r1));
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .8;
  flex-shrink: 0;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent, var(--r1)) 30%, transparent);
}
.module-body {
  padding: 1rem 1.4rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.r1-module { --accent: var(--r1); }
.r2-module { --accent: var(--r2); }
.r3-module { --accent: var(--r3); }
.r4-module { --accent: var(--r4); }
.r5-module { --accent: var(--r5); }

.stat-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .2s;
}
.stat-row:hover { border-color: var(--border-lit); }
.stat-label  { font-family:var(--font-mono); font-size:.62rem; color:var(--muted); letter-spacing:.08em; text-transform:uppercase; flex:1; }
.stat-value  { font-family:var(--font-mono); font-size:.85rem; color:var(--r1); font-weight:500; transition:color .3s; text-shadow: 0 0 8px rgba(0,212,255,0.3); }
.stat-value.updating { color:var(--accent, var(--r1)); animation:statFlash .6s ease; }
@keyframes statFlash { 0%,100%{opacity:1} 50%{opacity:.2} }

.hint-text {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--muted);
  padding: .4rem .7rem;
  background: rgba(0,212,255,0.03);
  border-left: 2px solid var(--r1);
  border-radius: 0 4px 4px 0;
}

.field { display: flex; flex-direction: column; gap: .3rem; }
.field label {
  font-family: var(--font-mono);
  font-size: .62rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
input[type="text"],
input[type="number"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .9rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--white);
  outline: none;
  transition: border-color .22s, box-shadow .22s;
}
input:focus {
  border-color: var(--accent, var(--r1));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--r1)) 10%, transparent),
              0 0 12px color-mix(in srgb, var(--accent, var(--r1)) 15%, transparent);
}
input::placeholder { color: var(--muted); }

.btn {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  padding: .62rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  transition: all .22s;
  text-transform: uppercase;
}
.btn-primary {
  background: transparent;
  border-color: var(--accent, var(--r1));
  color: var(--accent, var(--r1));
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent, var(--r1));
  opacity: 0;
  transition: opacity .22s;
}
.btn-primary:hover::before { opacity: 0.12; }
.btn-primary:hover {
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent, var(--r1)) 45%, transparent),
              inset 0 0 20px color-mix(in srgb, var(--accent, var(--r1)) 5%, transparent);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border-color: var(--border-lit);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent, var(--r1));
  color: var(--accent, var(--r1));
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent, var(--r1)) 20%, transparent);
}
.btn-yes     { background: transparent; border-color: var(--r2); color: var(--r2); font-weight: 700; }
.btn-no      { background: transparent; border-color: var(--danger); color: var(--danger); font-weight: 700; }
.btn-yes:hover { box-shadow: 0 0 16px rgba(0,255,159,.4); background: rgba(0,255,159,0.08); }
.btn-no:hover  { box-shadow: 0 0 16px rgba(255,61,87,.4);  background: rgba(255,61,87,0.08); }
.btn:disabled  { opacity:.25; cursor:not-allowed; filter:none; box-shadow:none; }
.btn-row       { display: flex; gap: .6rem; flex-wrap: wrap; }

.vote-bar-wrap   { padding:.8rem; background:var(--surface); border:1px solid var(--border); border-radius:8px; }
.vote-bar-labels { display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:.65rem; color:var(--muted); margin-bottom:.4rem; }
.yes-txt { color: var(--r2); }
.no-txt  { color: var(--danger); }
.vote-track { height:4px; background:var(--border); border-radius:3px; overflow:hidden; }
.vote-fill  { height:100%; background:var(--r2); border-radius:3px; transition:width .6s ease; width:0%; box-shadow: 0 0 8px var(--r2); }
.vote-status{ margin-top:.4rem; font-family:var(--font-mono); font-size:.62rem; color:var(--muted); text-align:right; }

#lookupResult {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border: 1px solid rgba(0,212,255,.15);
  border-radius: 8px;
}

/* ══════════════════════════════════════════════════════
   TX LOG
══════════════════════════════════════════════════════ */
.txlog { border:1px solid var(--border); border-radius:var(--radius); background:var(--card); overflow:hidden; margin-bottom:2rem; }
.txlog-header { padding:1rem 1.5rem; display:flex; align-items:center; gap:.6rem; border-bottom:1px solid var(--border); }
.txlog-icon   { font-size:.9rem; }
.txlog-title  { font-family:var(--font-display); font-size:.95rem; letter-spacing:.12em; color:var(--white); flex:1; }
.live-badge   {
  font-family:var(--font-mono); font-size:.55rem;
  padding:2px 8px;
  background:rgba(0,212,255,.08);
  border:1px solid rgba(0,212,255,.25);
  color:var(--r1); border-radius:3px; letter-spacing:.12em;
  animation:dotPulse 2s infinite;
  text-transform: uppercase;
}
#txList { list-style:none; max-height:180px; overflow-y:auto; }
#txList:empty::after {
  content:'[ NO TRANSACTIONS YET — INTERACT WITH CONTRACTS ABOVE ]';
  display:block; padding:1.5rem;
  font-family:var(--font-mono); font-size:.62rem; color:var(--muted); text-align:center;
  letter-spacing: .08em;
}
.tx-item {
  display:flex; align-items:center; gap:.8rem;
  padding:.7rem 1.5rem; border-bottom:1px solid var(--border);
  animation: slideIn .3s ease;
}
@keyframes slideIn { from{opacity:0;transform:translateX(-10px)} to{opacity:1;transform:translateX(0)} }
.tx-desc { flex:1; font-family:var(--font-mono); font-size:.68rem; color:var(--text); }
.tx-hash { font-family:var(--font-mono); font-size:.62rem; color:var(--muted); text-decoration:none; transition:color .22s; }
.tx-hash:hover { color:var(--r1); text-shadow: 0 0 8px var(--r1); }
.tx-time { font-family:var(--font-mono); font-size:.6rem; color:var(--muted); }

/* ══════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════ */
#toast { position:fixed; bottom:2rem; right:2rem; z-index:999; display:flex; flex-direction:column; gap:.5rem; pointer-events:none; }
.toast-item {
  font-family:var(--font-mono); font-size:.72rem;
  padding:.7rem 1.2rem; background:var(--card);
  border:1px solid var(--border); border-radius:8px;
  color:var(--white); display:flex; align-items:center; gap:.5rem;
  animation:toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  box-shadow:0 8px 24px rgba(0,0,0,.5);
  letter-spacing: .04em;
}
.toast-item.success { border-color:rgba(0,255,159,.4); color: var(--r2); }
.toast-item.error   { border-color:rgba(255,61,87,.4); color: var(--danger); }
.toast-item.info    { border-color:rgba(0,212,255,.4); color: var(--r1); }
@keyframes toastIn  { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes toastOut { from{opacity:1} to{opacity:0} }

/* ══════════════════════════════════════════════════════
   LOADING OVERLAY
══════════════════════════════════════════════════════ */
.loading-overlay {
  position:fixed; inset:0; z-index:200;
  background:rgba(1,10,15,.93); backdrop-filter:blur(8px);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1.2rem;
  opacity:0; pointer-events:none; transition:opacity .3s;
}
.loading-overlay.active { opacity:1; pointer-events:all; }
.spinner-wrap { position:relative; width:50px; height:50px; }
.spinner      { width:50px; height:50px; border:2px solid var(--border); border-top-color:var(--r1); border-radius:50%; animation:spin .8s linear infinite; box-shadow: 0 0 20px rgba(0,212,255,0.3); }
.spinner-ring { position:absolute; inset:7px; border:1px solid var(--border); border-bottom-color:var(--r2); border-radius:50%; animation:spin 1.4s linear infinite reverse; }
@keyframes spin { to{transform:rotate(360deg)} }
.loading-msg  { font-family:var(--font-mono); font-size:.78rem; color:var(--r1); letter-spacing:.12em; text-transform: uppercase; text-shadow: 0 0 12px rgba(0,212,255,0.5); }

/* ══════════════════════════════════════════════════════
   ROOM 5 — GUESTBOOK
══════════════════════════════════════════════════════ */
.r5-tag {
  background: rgba(0,255,204,.08);
  border: 1px solid rgba(0,255,204,.3);
  color: var(--r5);
  font-family: var(--font-mono);
  font-size: .6rem;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .08em;
  white-space: nowrap;
}

.r5-btn {
  background: transparent;
  border: 1px solid rgba(0,255,204,.4);
  color: var(--r5);
}
.r5-btn:hover {
  background: rgba(0,255,204,.08);
  box-shadow: 0 0 20px rgba(0,255,204,.25);
}

.guest-feed-label {
  font-family: var(--font-mono);
  font-size: .62rem;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 1rem 0 .5rem;
}

.guest-feed {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-right: .2rem;
}

.guest-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .7rem .9rem;
  transition: border-color .2s;
}
.guest-entry:hover { border-color: rgba(0,255,204,.3); }

.guest-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .35rem;
}

.guest-address {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--r5);
  text-decoration: none;
  transition: opacity .2s;
}
.guest-address:hover { opacity: .75; }

.guest-date {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--muted);
}

.guest-message {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.guest-empty {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--muted);
  text-align: center;
  padding: 1.2rem;
  letter-spacing: .08em;
}

.guest-feed::-webkit-scrollbar       { width: 4px; }
.guest-feed::-webkit-scrollbar-track { background: transparent; }
.guest-feed::-webkit-scrollbar-thumb { background: var(--border-lit); border-radius: 2px; }

/* ══════════════════════════════════════════════════════
   CERTIFICATE MODAL
══════════════════════════════════════════════════════ */
.cert-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(1,10,15,0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.cert-modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.cert-modal {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--r3);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(123,97,255,0.2),
    0 0 60px rgba(123,97,255,0.15),
    0 40px 80px rgba(0,0,0,0.6);
  transform: translateY(30px) scale(0.96);
  transition: transform .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cert-modal-backdrop.active .cert-modal {
  transform: translateY(0) scale(1);
}

/* Top scan line animation */
.cert-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--r3), var(--r1), transparent);
  animation: scanLine 3s linear infinite;
  z-index: 1;
}
@keyframes scanLine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.cert-header {
  padding: 1.2rem 1.5rem;
  background: linear-gradient(135deg, rgba(123,97,255,0.1), rgba(0,212,255,0.05));
  border-bottom: 1px solid rgba(123,97,255,0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cert-header-left { display: flex; align-items: center; gap: .8rem; }
.cert-header-icon { font-size: 1.5rem; filter: drop-shadow(0 0 12px rgba(123,97,255,0.6)); }
.cert-header-title {
  font-family: var(--font-display);
  font-size: .9rem;
  letter-spacing: .16em;
  color: var(--white);
  text-transform: uppercase;
}
.cert-header-sub {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--r3);
  letter-spacing: .1em;
  margin-top: 2px;
}
.cert-close-btn {
  background: transparent;
  border: 1px solid var(--border-lit);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  font-family: var(--font-mono);
}
.cert-close-btn:hover { border-color: var(--danger); color: var(--danger); box-shadow: 0 0 10px rgba(255,61,87,0.3); }

.cert-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

/* Token ID + Name row */
.cert-identity {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid rgba(123,97,255,0.2);
  border-radius: 10px;
}
.cert-token-id {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--r3);
  letter-spacing: .06em;
  line-height: 1;
  text-shadow: 0 0 30px rgba(123,97,255,0.5);
  flex-shrink: 0;
}
.cert-name-block {}
.cert-student-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--white);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.cert-course-id {
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .12em;
  margin-top: 2px;
}

/* ── Skills badge row (NEW) ── */
.cert-skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.cert-skill-badge {
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .1em;
  color: var(--r1);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 4px;
  padding: .22rem .55rem;
  text-transform: uppercase;
  transition: border-color .2s, box-shadow .2s;
}
.cert-skill-badge:hover {
  border-color: var(--r1);
  box-shadow: 0 0 8px rgba(0,212,255,0.2);
}

/* Info grid — 3 columns (UPDATED from 2) */
.cert-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .7rem;
}
.cert-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  transition: border-color .2s;
}
.cert-cell:hover { border-color: rgba(0,212,255,0.2); }
.cert-cell-label {
  font-family: var(--font-mono);
  font-size: .55rem;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .3rem;
}
.cert-cell-value {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--white);
  line-height: 1.3;
}
.cert-cell-value.accent { color: var(--r1); text-shadow: 0 0 8px rgba(0,212,255,0.3); }
.cert-cell-value.green  { color: var(--r2); text-shadow: 0 0 8px rgba(0,255,159,0.3); }

/* Status badge */
.cert-status-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1rem;
  background: rgba(0,255,159,0.04);
  border: 1px solid rgba(0,255,159,0.15);
  border-radius: 8px;
}
.cert-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--r2);
  box-shadow: 0 0 10px var(--r2);
  animation: dotPulse 2s infinite;
  flex-shrink: 0;
}
.cert-status-text {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--r2);
  letter-spacing: .1em;
  text-transform: uppercase;
  flex: 1;
}
.cert-status-sub {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--muted);
  letter-spacing: .06em;
}

/* Wallet */
.cert-wallet {
  padding: .65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.cert-wallet-label {
  font-family: var(--font-mono);
  font-size: .55rem;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .25rem;
}
.cert-wallet-addr {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--r1);
  text-shadow: 0 0 8px rgba(0,212,255,0.3);
  word-break: break-all;
}

/* TX Hash */
.cert-tx {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.cert-tx-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--r3);
  box-shadow: 0 0 8px var(--r3);
  flex-shrink: 0;
}
.cert-tx-label {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.cert-tx-hash {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--r3);
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s;
}
.cert-tx-hash:hover { color: var(--r1); text-shadow: 0 0 8px rgba(0,212,255,0.4); }
.cert-tx-ext {
  font-size: .7rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
  flex-shrink: 0;
}
.cert-tx-ext:hover { color: var(--r1); }

/* Verified seal */
.cert-verified-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: .8rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
}
.cert-seal-icon {
  width: 52px; height: 52px;
  border: 2px solid var(--r2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 20px rgba(0,255,159,0.3), inset 0 0 20px rgba(0,255,159,0.05);
  animation: sealPulse 3s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes sealPulse {
  0%,100% { box-shadow: 0 0 20px rgba(0,255,159,0.3), inset 0 0 20px rgba(0,255,159,0.05); }
  50%      { box-shadow: 0 0 35px rgba(0,255,159,0.5), inset 0 0 30px rgba(0,255,159,0.1); }
}
.cert-seal-text {
  font-family: var(--font-display);
  font-size: .7rem;
  letter-spacing: .2em;
  color: var(--r2);
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(0,255,159,0.4);
}
.cert-seal-sub {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--muted);
  letter-spacing: .08em;
  margin-top: 2px;
}

/* Footer bar */
.cert-footer {
  padding: .6rem 1.5rem;
  background: rgba(0,212,255,0.02);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cert-footer-left {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.cert-footer-right {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--r1);
  letter-spacing: .1em;
  opacity: .6;
}
/* ══════════════════════════════════════════════════════
   MINTED CERTIFICATES GALLERY
   Paste at the very bottom of your style.css
   REPLACES previous gallery CSS block entirely
══════════════════════════════════════════════════════ */

#certGallery {
  width: 100%;
  margin: 2rem 0 1rem;
  padding: 1.75rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border-lit);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(0,212,255,0.04);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}

.gallery-title {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .14em;
  color: var(--white);
  text-shadow: 0 0 16px rgba(0,212,255,0.2);
}

.gallery-count {
  font-family: var(--font-mono);
  font-size: .62rem;
  color: var(--r1);
  letter-spacing: .1em;
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 4px;
  padding: .2rem .6rem;
}

.cert-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.cert-mini-card {
  background: var(--surface);
  border: 1px solid var(--border-lit);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .25s, box-shadow .25s, transform .25s;
  animation: cardIn .45s cubic-bezier(0.34,1.56,0.64,1);
}
.cert-mini-card::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--r1), var(--r2));
  box-shadow: 0 0 10px var(--r1);
}
.cert-mini-card:hover {
  border-color: var(--r1);
  box-shadow: 0 0 28px rgba(0,212,255,0.12), 0 8px 32px rgba(0,0,0,0.4);
  transform: translateY(-3px);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cmc-body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  flex: 1;
}

.cmc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.cmc-token {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--r1);
  letter-spacing: .06em;
  line-height: 1;
  text-shadow: 0 0 20px rgba(0,212,255,0.4);
}
.cmc-verified {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--r2);
  letter-spacing: .1em;
  border: 1px solid rgba(0,255,159,0.3);
  border-radius: 4px;
  padding: .25rem .6rem;
  background: rgba(0,255,159,0.05);
}

.cmc-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--white);
  letter-spacing: .1em;
}

.cmc-skills {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.cmc-badge {
  font-family: var(--font-mono);
  font-size: .56rem;
  letter-spacing: .08em;
  color: var(--r1);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 3px;
  padding: .18rem .45rem;
  text-transform: uppercase;
  background: rgba(0,212,255,0.04);
}

.cmc-divider { height: 1px; background: var(--border); }

.cmc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cmc-label {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.cmc-value {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--text);
}
.cmc-value.accent {
  color: var(--r1);
  text-shadow: 0 0 8px rgba(0,212,255,0.3);
}
.cmc-link {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--r2);
  text-decoration: none;
  transition: color .2s;
}
.cmc-link:hover { color: var(--r1); text-shadow: 0 0 8px rgba(0,212,255,0.4); }

.cmc-footer {
  font-family: var(--font-mono);
  font-size: .55rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-align: center;
  padding: .6rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0,212,255,0.02);
  text-transform: uppercase;
}

.cmc-citizen {
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--muted);
  margin-bottom: .5rem;
}