/* The Souls Gazette — look of the main menu, editor and tutorial (Minecraft menus).
   The newspaper page itself is styled by gazette.css. */

@import url("https://fonts.googleapis.com/css2?family=Jacquard+24&family=Pixelify+Sans:wght@400;500;600;700&display=swap");

@font-face {
  font-family: "Minecraft";
  src: url("https://cdn.jsdelivr.net/npm/typeface-minecraft@1.0.0/files/minecraft.woff2") format("woff2"),
       url("https://cdn.jsdelivr.net/npm/typeface-minecraft@1.0.0/files/minecraft.woff") format("woff");
  font-display: swap;
}

:root {
  --mc: "Minecraft", "Pixelify Sans", monospace;
  --title: "Jacquard 24", serif;
  --desk: #2b2926;
  --desk-2: #35322e;
  --panel: #c6c6c6;          /* inventory grey */
  --panel-text: #3f3f3f;
  --hi: #ffffff;
  --lo: #555555;
  --slot: #8b8b8b;
  --btn: #6f6f6f;
  --green: #3c8527;
  --red: #a8322a;
  --yellow: #ffffa0;
  --paper: #f3eee3;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.app {
  min-height: 100vh;
  background: var(--desk);
  color: #f0eee8;
  font: 16px/24px var(--mc);
  -webkit-font-smoothing: none;
}
a { color: inherit; }
[hidden] { display: none !important; }

/* Bold the way Minecraft draws it: the text again, one pixel to the right. (The Minecraft font
   has no bold, and the browser's fake bold smears it.) */
body.app b, body.app strong { font-weight: 400; text-shadow: 1px 0 0 currentColor; }


/* ---------- Scrollbars (like the creative inventory's) ---------- */

::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-track { background: #1b1a18; box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 #3a3733; }
::-webkit-scrollbar-thumb { background: #c6c6c6; border: 2px solid #000; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555; }
::-webkit-scrollbar-thumb:hover { background: #dcdcdc; }
::-webkit-scrollbar-corner { background: #1b1a18; }
.panel::-webkit-scrollbar-track, .panel ::-webkit-scrollbar-track { background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-color: #c6c6c6 #1b1a18; } }

/* ---------- Buttons (Minecraft menu buttons) ---------- */

.mc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px;
  padding: 6px 14px 7px;
  font: 16px/1 var(--mc);
  color: #fff;
  text-decoration: none;
  text-shadow: 2px 2px 0 #3f3f3f;
  white-space: nowrap;
  background: var(--btn);
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #a8a8a8, inset -2px -3px 0 #4a4a4a;
  cursor: pointer;
}
.mc-btn:hover, .mc-btn:focus-visible { color: var(--yellow); background: #7b86b8; box-shadow: inset 2px 2px 0 #b9c2ee, inset -2px -3px 0 #4b5585; outline: none; }
.mc-btn:active { box-shadow: inset -2px -2px 0 #a8a8a8, inset 2px 3px 0 #4a4a4a; }
.mc-btn[disabled] { color: #a0a0a0; background: #3a3a3a; box-shadow: none; cursor: default; text-shadow: none; }
.mc-btn.primary { background: var(--green); box-shadow: inset 2px 2px 0 #6fbf55, inset -2px -3px 0 #24561a; }
.mc-btn.danger { background: var(--red); box-shadow: inset 2px 2px 0 #d8665e, inset -2px -3px 0 #6a1b16; }
.mc-btn.small { min-height: 30px; padding: 3px 8px 5px; font-size: 16px; }
.mc-btn.icon { padding-left: 9px; padding-right: 9px; }

/* ---------- Panels (inventory windows) ---------- */

.panel {
  background: var(--panel);
  color: var(--panel-text);
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
  padding: 14px 16px;
}
.panel h2, .panel h3 { margin: 0 0 10px; font: 16px/1.2 var(--mc); color: var(--panel-text); }
.slot {           /* sunken box inside a panel */
  background: var(--slot);
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
  padding: 8px 10px;
}

/* ---------- Text fields (black Minecraft text boxes) ---------- */

.mc-input, .mc-select {
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  font: 16px var(--mc);
  color: #fff;
  background: #000;
  border: 2px solid #a0a0a0;
  border-radius: 0;
}
.mc-input:focus, .mc-select:focus { border-color: #fff; outline: none; }
.mc-select { appearance: none; padding-right: 26px;
  background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h5v1H4v1H3v1H2V2H1V1H0z' fill='%23fff'/%3E%3C/svg%3E") right 9px center / 10px 6px no-repeat; }
label.field { display: block; margin: 0 0 10px; }
label.field > span { display: block; margin-bottom: 4px; font-size: 16px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px;
  background: #1b1a18;
  border-bottom: 2px solid #000;
  box-shadow: 0 2px 0 #3a3733;
}
.topbar .grow { flex: 1; min-width: 8px; }
.topbar .who { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; line-height: 1; color: #c9c4ba; }
.topbar .who .title-badge { vertical-align: 0; }

.wordmark { display: inline-flex; align-items: center; gap: 8px; font: 43px/1 var(--title); color: var(--paper); text-decoration: none; text-shadow: 2px 2px 0 #000; white-space: nowrap; }
.wordmark .logo { width: 32px; height: 32px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 #000); }

/* ---------- Avatars ---------- */

.avatars { display: flex; gap: 4px; }
.avatar {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  font: 16px/20px var(--mc); color: #fff; text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -2px 0 rgba(0,0,0,.3);
}

/* faces keep their exact size (the coloured ring is drawn outside), so pixels stay even */
.avatar.face { padding: 0; border: 0; background: #000; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--ring, #000); }
.title-badge {
  display: inline-block;
  padding: 1px 5px 2px;
  font: 16px/20px var(--mc); color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.5);
  border: 2px solid #000;
  vertical-align: 1px;
}

.ln { display: block; }   /* centred lines split one per line, see snapTextIn in gazette.js */

/* pixel icons inside buttons and labels */
[data-px] { display: inline-flex; align-items: center; vertical-align: middle; }
[data-px] svg, [data-px] img { display: block; }
.btnname { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }

/* ---------- Pop-up windows ---------- */

.modal-back {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .6);
}
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.modal p { margin: 0 0 10px; }

/* Radio choices inside pop-ups (one per row) */
.choice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 6px; cursor: pointer; color: #1e1e1e; }
.choice input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); }
.choice span { display: grid; gap: 2px; }
.choice small { font-size: 16px; color: #303030; }
.choice:has(input:checked) { outline: 2px solid #fff; outline-offset: -2px; }

/* ---------- Menus ---------- */

.menu {
  position: fixed; z-index: 120;
  min-width: 190px;
  padding: 4px;
  background: #100f0e;
  border: 2px solid #2d1a5c;
  box-shadow: 0 0 0 2px #100f0e, 4px 4px 0 rgba(0,0,0,.4);   /* tooltip look */
}
.menu button {
  display: block; width: 100%;
  padding: 6px 10px;
  font: 16px var(--mc); color: #fff; text-align: left;
  background: none; border: 0; cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: #2d2a40; color: var(--yellow); outline: none; }
.menu hr { border: 0; border-top: 2px solid #2b2b2b; margin: 4px 0; }

/* ---------- Toasts ---------- */

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 200;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  background: #100f0e; color: #fff;
  border: 2px solid #2d1a5c;
  box-shadow: 0 0 0 2px #100f0e;
  font: 16px var(--mc);
}
.toast.bad { border-color: #8a2a22; }

@media (max-width: 640px) {
  .mc-btn { font-size: 16px; padding-left: 10px; padding-right: 10px; }
}
