/* ROLU onchain portal. Same tokens as roluworks.com (index.html): near-black ground, bone text, one cyan accent,
   Courier for display and controls, the system sans for reading. */
:root {
  --bg: #0c0c0c; --surface: #111111; --raise: #161616; --border: #222222; --border2: #2e2e2e;
  --text: #d4d0c8; --body: #9a958c; --muted: #6b675f; --faint: #3a3936;
  --accent: #00e5ff; --accent-dim: rgba(0, 229, 255, 0.13); --accent-ink: #001417;
  --warn: #ffb547; --bad: #ff6b5a;
  --font-display: 'Courier New', Courier, monospace;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 64px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font-body); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

/* ── nav (matches the main site) ── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 0 2rem; border-bottom: 1px solid var(--border); background: rgba(12, 12, 12, 0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.nav .logo { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); text-decoration: none; white-space: nowrap; }
.nav .logo span { color: var(--text); }
.nav-links { display: flex; gap: 2rem; font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--accent); }
.wallet-slot { position: relative; flex: none; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 40px; padding: 0.55rem 1.2rem; border: 1px solid var(--border2); background: none; font-family: var(--font-display); font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-line { border-color: var(--accent); color: var(--accent); }
.btn-line:hover { background: var(--accent-dim); border-color: var(--accent); }
.btn-solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-solid:hover { background: #5ff0ff; }
.btn-quiet { border-color: transparent; color: var(--body); padding-left: 0.4rem; padding-right: 0.4rem; }
.btn-quiet:hover { color: var(--accent); border-color: transparent; }
.wl-btn { padding-left: 0.6rem; }
.wl-btn.warn { border-color: var(--warn); color: var(--warn); }
.wl-avatar { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.wl-addr { color: var(--muted); letter-spacing: 0.04em; text-transform: none; }
.wl-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border2); z-index: 60; }
.wl-menu a, .wl-menu button { text-align: left; padding: 0.75rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-size: 0.82rem; letter-spacing: 0.06em; text-decoration: none; cursor: pointer; color: var(--text); }
.wl-menu > :last-child { border-bottom: 0; }
.wl-menu a:hover, .wl-menu button:hover { background: var(--raise); color: var(--accent); }

/* ── wallet picker ── */
dialog { color: var(--text); }
.wl-modal { border: 1px solid var(--border2); background: var(--surface); padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.wl-modal::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(3px); }
.wl-box { padding: 1.4rem 1.4rem 1.2rem; }
.wl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.wl-head h2 { margin: 0; font: 400 1.15rem var(--font-display); letter-spacing: 0.06em; }
.wl-x { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 0.3rem; }
.wl-x:hover { color: var(--text); }
.wl-list { display: flex; flex-direction: column; border: 1px solid var(--border); }
.wl-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 0.9rem; padding: 0.8rem 0.9rem; background: none; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; font-size: 1rem; }
.wl-row:last-child { border-bottom: 0; }
.wl-row:hover { background: var(--raise); }
.wl-row img { border-radius: 6px; }
.wl-dot { width: 28px; height: 28px; border-radius: 6px; background: var(--raise); border: 1px solid var(--border2); }
.wl-dot.wc { background: #3b99fc; border-color: #3b99fc; }
.wl-tag { font: 0.72rem var(--font-display); color: var(--muted); letter-spacing: 0.08em; }
.wl-deep p { color: var(--body); margin: 0 0 0.8rem; }
.wl-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.wl-links a { border: 1px solid var(--border2); padding: 0.5rem 0.8rem; text-decoration: none; font-family: var(--font-display); font-size: 0.85rem; }
.wl-err { color: var(--bad); margin: 0.9rem 0 0; }
.wl-safe { color: var(--muted); font-size: 0.82rem; line-height: 1.5; margin: 1rem 0 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); max-width: calc(100vw - 32px); background: var(--text); color: var(--bg); padding: 0.65rem 1rem; font: 0.85rem var(--font-display); opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 200; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.footer { border-top: 1px solid var(--border); padding: 1.5rem 2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

@media (max-width: 760px) {
  .wrap { padding: 0 1.25rem; }
  .nav { padding: 0 1.25rem; gap: 0.8rem; }
  .nav-links { display: none; }
  .wl-btn .wl-addr { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ── Menu: Cryptarium drop-down (desktop) and ☰ menu (phones) ── */
.nav-links { align-items: center; }
.nav-item { position: relative; }
.nav-item > a { display: inline-block; padding: 0.4rem 0; color: var(--muted); text-decoration: none; }
.nav-item > a[aria-current], .nav-item > a:hover { color: var(--accent); }
.has-drop > a::after { content: ''; display: inline-block; width: 0.4em; height: 0.4em; margin-left: 0.45em; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-0.2em) rotate(45deg); opacity: 0.7; }
/* A bridge of padding under the trigger keeps the menu open while the pointer travels down into it. */
.nav-drop { position: absolute; top: 100%; left: -1.1rem; min-width: 13rem; padding-top: 1.35rem; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s; z-index: 60; isolation: isolate; }
.nav-drop::before { content: ''; position: absolute; inset: 1.35rem 0 0; background: #0e0e0e; border: 1px solid var(--border2); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); z-index: -1; }
.nav-drop a { padding: 0.7rem 1.1rem; color: #c9c5bd; text-decoration: none; letter-spacing: 0.14em; font-size: 0.78rem; white-space: nowrap; }
.nav-drop a:first-child { margin-top: 0.35rem; }
.nav-drop a:last-child { margin-bottom: 0.35rem; }
.nav-drop a:hover, .nav-drop a:focus-visible { color: var(--accent); background: rgba(0, 229, 255, 0.05); outline: none; }
.has-drop:hover .nav-drop, .has-drop:focus-within .nav-drop { opacity: 1; visibility: visible; transform: none; transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s; }
.nav-drop:not(:has(a)), .burger-sub:not(:has(a)) { display: none; }
.has-drop:not(:has(.nav-drop a)) > a::after { display: none; }

.nav-burger { display: none; position: relative; }
.nav-burger summary { list-style: none; width: 42px; height: 42px; display: grid; place-content: center; gap: 5px; border: 1px solid var(--border2); cursor: pointer; }
.nav-burger summary::-webkit-details-marker { display: none; }
.nav-burger summary i { display: block; width: 18px; height: 1px; background: var(--text); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-burger[open] summary i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger[open] summary i:nth-child(2) { opacity: 0; }
.nav-burger[open] summary i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.burger-panel { position: fixed; top: var(--nav-h); left: 0; right: 0; height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); overflow-y: auto; background: var(--bg); border-bottom: 1px solid var(--border2); padding: 0.6rem 1.25rem 1.2rem; display: flex; flex-direction: column; font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.14em; z-index: 55; }
.burger-main { padding: 0.95rem 0; font-size: 0.95rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.burger-main[aria-current] { color: var(--accent); }
.burger-sub { display: flex; flex-direction: column; padding: 0.3rem 0 0.6rem 1rem; border-bottom: 1px solid var(--border); }
.burger-sub a { padding: 0.6rem 0; font-size: 0.8rem; color: var(--muted); text-decoration: none; }
.burger-sub a:hover, .burger-main:hover { color: var(--accent); }
/* The section in view (set by ui.js) */
.nav-drop a[aria-current], .burger-sub a[aria-current] { color: var(--accent); }

@media (max-width: 760px) {
  .nav-burger { display: block; }
  .nav .wallet-slot { margin-left: auto; }
}
