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

:root {
  --amber: #ffb000;
  --amber-dim: #cc8d00;
  --amber-glow: rgba(255, 176, 0, 0.5);
  --amber-faint: rgba(255, 176, 0, 0.15);
  --bg: #0a0a0a;
  --popup-bg: #111;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--amber);
  font-family: "Courier New", Courier, monospace;
  text-shadow: 0 0 5px var(--amber-glow);
  min-height: 100vh;
  padding: 2rem 1rem 6rem;
  overflow-x: hidden;
  overflow-y: scroll;
}

/* Always show + theme scrollbars (Windows 3.1 / IRIX-ish) */
html, body {
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #5c5c5c #b3b3b3;
}

::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: #b3b3b3;

}

::-webkit-scrollbar-thumb {
  background: #8c8c8c;
  border: 2px solid #b3b3b3;
  box-shadow: inset 1px 1px 0 #e6e6e6, inset -1px -1px 0 #5c5c5c;
}

::-webkit-scrollbar-button:single-button {
  display: block;
  background: #b3b3b3;
  border: 2px solid #b3b3b3;
  box-shadow: inset 1px 1px 0 #e6e6e6, inset -1px -1px 0 #5c5c5c;
  height: 16px;
  width: 16px;
}

::-webkit-scrollbar-button:single-button:vertical:decrement {
  background:
    linear-gradient(135deg, transparent 50%, #000 50%) 6px 9px / 4px 4px no-repeat,
    #b3b3b3;
}

::-webkit-scrollbar-button:single-button:vertical:increment {
  background:
    linear-gradient(-45deg, transparent 50%, #000 50%) 6px 7px / 4px 4px no-repeat,
    #b3b3b3;
}

::-webkit-scrollbar-button:single-button:horizontal:decrement {
  background:
    linear-gradient(45deg, transparent 50%, #000 50%) 9px 6px / 4px 4px no-repeat,
    #b3b3b3;
}

::-webkit-scrollbar-button:single-button:horizontal:increment {
  background:
    linear-gradient(-135deg, transparent 50%, #000 50%) 7px 6px / 4px 4px no-repeat,
    #b3b3b3;
}

::-webkit-scrollbar-corner {
  background: #b3b3b3;
  box-shadow: inset 1px 1px 0 #e6e6e6, inset -1px -1px 0 #5c5c5c;
}

/* ── scanline overlay ── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 900;
}

/* ── logo ── */
#logo-wrapper {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  margin-bottom: 2rem;
}

#logo {
  font-family: "Courier New", Courier, monospace;
  white-space: pre;
  line-height: 1.2;
  font-size: clamp(0.35rem, 1.4vw, 1rem);
  color: var(--amber);
  text-shadow: 0 0 8px var(--amber-glow);
  user-select: none;
}

/* ── text frame ── */
#text-frame {
  max-width: 72ch;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 1rem;
  padding: 1rem 1rem 5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-height: 4rem;
}

#text-frame p {
  margin-bottom: 1em;
}

#text-frame strong {
  color: #ffd080;
  font-weight: bold;
}

#text-frame em {
  font-style: italic;
  color: var(--amber-dim);
}

/* blinking cursor for typing effect */
.typing-cursor {
  display: inline;
  animation: blink var(--cursor-blink-rate, 700ms) step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* flash transition for unredact */
#text-frame {
  transition: background 0.15s;
}

#text-frame.flash {
  background: var(--amber);
}

#text-frame.flash,
#text-frame.flash strong,
#text-frame.flash em {
  color: var(--amber);
  text-shadow: none;
}

/* ── fixed buttons ── */
#hack-btn,
#vault-btn {
  position: fixed;
  z-index: 1000;
  left: 1.5rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--bg);
  border: 2px solid var(--amber);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  text-shadow: 0 0 5px var(--amber-glow);
  transition: box-shadow 0.2s, background 0.2s;
}

#hack-btn:hover,
#vault-btn:hover {
  box-shadow: 0 0 12px var(--amber-glow), inset 0 0 12px var(--amber-faint);
  background: rgba(255, 176, 0, 0.08);
}

#logout-btn {
  position: fixed;
  z-index: 1000;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--bg);
  border: 2px solid var(--amber);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  text-shadow: 0 0 5px var(--amber-glow);
  transition: box-shadow 0.2s, background 0.2s;
  text-decoration: none;
}

#logout-btn:hover {
  box-shadow: 0 0 12px var(--amber-glow), inset 0 0 12px var(--amber-faint);
  background: rgba(255, 176, 0, 0.08);
}

#hack-btn {
  bottom: 1.5rem;
}

#vault-btn {
  bottom: 1.5rem;
  display: none;
}


/* ── overlays ── */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
}

.overlay.hidden {
  display: none;
}

/* ── passcode pop-up ── */
#passcode-popup {
  background: var(--popup-bg);
  border: 2px solid var(--amber);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 280px;
  max-width: 90vw;
  box-shadow: 0 0 30px rgba(255, 176, 0, 0.2);
}

#passcode-input {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.1rem;
  background: #000;
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  padding: 0.6rem 0.8rem;
  outline: none;
  text-shadow: 0 0 5px var(--amber-glow);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#passcode-input::placeholder {
  color: var(--amber-dim);
  opacity: 0.5;
}

#passcode-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 8px var(--amber-glow);
}

#unredact-btn {
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  font-weight: bold;
  color: var(--bg);
  background: var(--amber);
  border: none;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background 0.2s;
}

#unredact-btn:hover {
  background: #ffd080;
}

/* ── QR pop-up ── */
#qr-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

#qr-overlay.hidden {
  display: none;
}

#qr-panel {
  width: 100%;
  background: var(--amber);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  gap: 0.5rem;
}

.qr-label {
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  font-weight: bold;
  color: var(--bg);
  text-shadow: none;
  text-align: center;
  letter-spacing: 0.05em;
}

.qr-diamonds {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
}

.qr-diamondMask {
  width: 56px;
  height: 56px;
  display: inline-block;

  -webkit-mask-image: url("../images/diamond.png");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;

  mask-image: url("../images/diamond.png");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;

  background-blend-mode: multiply;
}

.diamond-white { background-color: #ffffff; background-blend-mode: multiply;}
.diamond-black { background-color: #000000; background-blend-mode: multiply;}
.diamond-blue { background-color: #193bad; background-blend-mode: multiply;}
