/* ---------------------------------------------------------------------------
   Console look for imported PS5 chain pages.

   The exploit pages are third-party and each has its own look, which made the
   PS5 side feel like a different product. This sheet is applied to every page
   the host serves, so the whole flow reads as one thing.

   It only touches colour, background, typography and the shape of controls.
   Nothing is hidden, moved or made unclickable: a page whose layout we do not
   know must keep working exactly as its author wrote it.
   --------------------------------------------------------------------------- */

@font-face {
  font-family: "Pencil";
  src: url("fonts/pencil.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f4ef;
  --card: #fefdfb;
  --ink: #191817;
  --muted: #7d7769;
  --line: #ded9cc;
  --pencil: "Pencil", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive, sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
}

html, body {
  background: var(--paper) !important;
  background-image: radial-gradient(rgba(25,24,23,.06) 1px, transparent 1px) !important;
  background-size: 22px 22px !important;
  color: var(--ink) !important;
}

body {
  font-family: var(--pencil) !important;
  padding-bottom: 56px !important;      /* room for the status bar */
}

/* headings and prose inherit the hand-drawn voice */
h1, h2, h3, h4, h5, h6, p, li, span, label, td, th, div {
  color: inherit;
}
h1, h2, h3, h4 {
  font-family: var(--pencil) !important;
  font-weight: 400 !important;
  letter-spacing: .04em !important;
  color: var(--ink) !important;
}

/* anything that looks like a panel becomes an index card */
section, article, aside, main, form, fieldset,
[class*="card"], [class*="panel"], [class*="box"], [class*="modal"], [class*="dialog"] {
  background: var(--card) !important;
  border: 2px solid var(--ink) !important;
  border-radius: 14px 4px 16px 4px / 4px 16px 4px 14px !important;
  color: var(--ink) !important;
}

/* controls become sketchy */
button, input[type=button], input[type=submit], input[type=reset], a.button, a[role=button] {
  background: var(--ink) !important;
  color: var(--paper) !important;
  border: 2px solid var(--ink) !important;
  border-radius: 12px 4px 14px 4px / 4px 14px 4px 12px !important;
  font-family: var(--pencil) !important;
  font-size: 1.05em !important;
  letter-spacing: .05em !important;
  padding: .6em 1.1em !important;
  cursor: pointer !important;
}
button:disabled, input:disabled {
  opacity: .45 !important;
  cursor: not-allowed !important;
}

input[type=text], input[type=search], input[type=url], input[type=email],
input[type=number], input[type=password], select, textarea {
  background: #fff !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink) !important;
  border-radius: 10px 3px 12px 3px / 3px 12px 3px 10px !important;
  font-family: var(--mono) !important;
  padding: .5em .7em !important;
}

a { color: var(--ink) !important; }
a:hover { color: #4a453d !important; }

code, pre, kbd, samp, .mono {
  font-family: var(--mono) !important;
  background: #efece4 !important;
  color: var(--ink) !important;
  border-radius: 4px !important;
}

hr { border: 0 !important; border-top: 2px dashed var(--line) !important; }

::selection { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- status bar
   Progress for whatever the page is doing. Sits below the content so it can
   never cover a button the exploit needs. */

#pencil-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  box-shadow: 0 -3px 0 rgba(25,24,23,.06);
  font-family: var(--mono);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
#pencil-bar .pb-in {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
}
#pencil-bar .pb-spin {
  width: 18px; height: 18px; flex: none;
  border: 2px solid var(--line); border-top-color: var(--ink);
  border-radius: 50%;
  animation: pb-spin .9s linear infinite;
}
#pencil-bar.done .pb-spin { animation: none; border-color: var(--ink); border-top-color: var(--ink); }
#pencil-bar.error .pb-spin { animation: none; border-color: #8a2b2b; border-top-color: #8a2b2b; }
@keyframes pb-spin { to { transform: rotate(360deg); } }
#pencil-bar .pb-text { flex: 1 1 auto; min-width: 0; color: var(--ink); }
#pencil-bar.error .pb-text { color: #8a2b2b; }
#pencil-bar .pb-btn {
  flex: none;
  font-family: var(--pencil);
  background: transparent; color: var(--muted);
  border: 0; padding: 2px 4px; cursor: pointer; text-decoration: underline;
}
#pencil-bar .pb-log {
  display: none;
  max-width: 1100px; margin: 0 auto;
  max-height: 168px; overflow-y: auto;
  padding: 0 14px 10px;
  white-space: pre-wrap; word-break: break-word;
  border-top: 1px dashed var(--line);
  margin-top: 2px;
}
#pencil-bar.open .pb-log { display: block; }
#pencil-bar .pb-log div { padding: 1px 0; }
#pencil-bar .pb-log .err { color: #8a2b2b; }
