/* ---------------------------------------------------------------------------
   Minecraft-style text for MiniMessage previews (store and admin panel).
   Three letterings, picked under Store text in the admin panel:
     soft   (default) Pixelify Sans: game-like but rounded
     pixel  Tiny5: blocky like the real game font (a 1/8 em grid, so 16px/24px stay crisp)
     mono   Monocraft: the Minecraft letter shapes, evenly spaced
     smooth the site's own body font, keeping the game colours and shadow
--------------------------------------------------------------------------- */
@font-face {
  font-family: 'Tiny5';
  src: url('/fonts/tiny5.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pixelify';
  src: url('/fonts/pixelify-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pixelify';
  src: url('/fonts/pixelify-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
:root {
  --mc-font: 'Pixelify', ui-rounded, system-ui, sans-serif;
  --mc-size: 19px;
  --mc-size-small: 15px;
  --mc-size-phone: 16px;
  --mc-smoothing: auto;
}
[data-game-font='pixel'] {
  --mc-font: 'Tiny5', ui-monospace, 'Courier New', monospace;
  --mc-size: 24px;
  --mc-size-small: 16px;
  --mc-size-phone: 16px;
  --mc-smoothing: none;
  --mc-shadow-offset: 0.125em 0.125em;
}
@font-face {
  font-family: 'Monocraft';
  src: url('/fonts/monocraft-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Monocraft';
  src: url('/fonts/monocraft-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
[data-game-font='mono'] {
  --mc-font: 'Monocraft', ui-monospace, 'Courier New', monospace;
  --mc-size: 17px;
  --mc-size-small: 14px;
  --mc-size-phone: 14px;
}
[data-game-font='smooth'] {
  --mc-font: 'Atkinson', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mc-size: 18px;
  --mc-size-small: 15px;
  --mc-size-phone: 16px;
}

.mc-text,
.mc-chip {
  font-family: var(--mc-font);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  color: #ffffff;
  -webkit-font-smoothing: var(--mc-smoothing);
}
/* The game's drop shadow: the same colour at a quarter brightness, one font pixel down and right. */
.mc-text span,
.mc-chip span {
  text-shadow: var(--mc-shadow, var(--mc-shadow-offset, 0.09em 0.09em) 0 color-mix(in srgb, currentColor 25%, #000000));
}
.mc-b {
  font-weight: 700;
}
.mc-i {
  font-style: italic;
}
.mc-u {
  text-decoration: underline;
  text-decoration-thickness: 0.125em;
  text-underline-offset: 0.125em;
}
.mc-s {
  text-decoration: line-through;
  text-decoration-thickness: 0.125em;
}
.mc-u.mc-s {
  text-decoration-line: underline line-through;
}
.mc-line {
  min-height: 1.25em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mc-text {
  line-height: 1.25;
}

/* Coloured words inside normal text, e.g. "Chat tag: [Kingpin]" */
.mc-chip {
  display: inline-block;
  padding: 0.0625em 0.375em 0.125em;
  margin: 0 0.0625em;
  border-radius: 3px;
  background: #23292a;
  font-size: var(--mc-size-small);
  line-height: 1.3;
  vertical-align: 0.0625em;
  white-space: pre-wrap;
}

/* A slice of the game: dark stone behind a chat box */
.mc-scene {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background-color: #2b3330;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    radial-gradient(120% 140% at 30% 0%, #3c4a41 0%, #222a27 70%);
  background-size:
    32px 32px,
    32px 32px,
    100% 100%;
  background-position:
    0 0,
    16px 16px,
    0 0;
}
.mc-scene .mc-text {
  justify-self: start;
  max-width: 100%;
  padding: 4px 10px 6px;
  background: rgba(0, 0, 0, 0.5);
  font-size: var(--mc-size);
}
.mc-scene-label {
  font-family: var(--body, system-ui, sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  color: #b9c6bf;
}
.mc-scene.is-compact {
  padding: 0;
  background: none;
  justify-self: start;
}
.mc-scene.is-compact .mc-text {
  padding: 3px 8px 5px;
  border-radius: 4px;
  background: #23292a;
  font-size: var(--mc-size-small);
}
@media (max-width: 600px) {
  .mc-scene:not(.is-compact) .mc-text {
    font-size: var(--mc-size-phone);
  }
}
