/* ============================================================================
   ГЛИФЫ - the drawn icons that replaced the emoji (Components/Shared/Glyph,
   paths in Components/Shared/Glyphs.cs, art in wwwroot/img/game and img/ui).

   An emoji was a character: it sat on the text line and took its size from
   the wrapper's font-size. The image keeps that contract. It is inline-block
   on the line, its square box is reserved by the width/height attributes
   before the file arrives (nothing reflows when it lands), and a flex row
   never squeezes it.

   Sizes follow what the emoji PAINTED, not its font-size: a colour emoji draws
   about 1.2em, the flat interface icons leave a little air inside their 64
   box and the game set carries about 10% built-in margin. So a call site asks
   for roughly 1.25x the old font-size for an interface icon and 1.35x for a
   game one (13px text: 16 and 18).

   After every component sheet, because the slot rules below adjust theirs;
   logical properties only, so it needs no line in the RTL layer.
   ============================================================================ */

.glyph {
    display: inline-block;
    flex: none;
    vertical-align: middle;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* The wrapper's font-size is the dial, exactly as it was for the emoji: the
   streak clock's flake (14px, 12px under 360px), the top-bar zzz (13px, 17px on
   desktop). 1.25em paints what the emoji painted at that font-size. */
.glyph-em {
    width: 1.25em;
    height: 1.25em;
}

/* Slots that are a box of their own - absolute badges and overlays, the flame
   beside the streak number, the confirm dialog's icon. The picture IS the box
   there, so it leaves the line: no strut, no baseline gap under the image, and
   the slot centres on the picture instead of on a line of text. */
.hero-streak-fire > .glyph,
.pet-injured-badge > .glyph,
.profile-pet-zzz > .glyph,
.profile-pet-lock > .glyph,
.pet-lock > .glyph,
.pet-zzz > .glyph,
.clock-flake > .glyph,
.confirm-icon > .glyph {
    display: block;
}

/* Icons set inside a line of words. The picture may be a pixel or two taller
   than the text (that is the size the emoji painted at), but it must not push
   the line box: a pet button or a weather hour that grew by a pixel when its
   emoji became a file is the jumping window the owner rules out. A negative
   block margin keeps the margin box inside the line; the image still paints at
   its full size, centred where it was. In em, so it scales with each line. */
.pet-action-btn .glyph,
.pet-expedition-result .glyph,
.reopen-regen .glyph,
.wx-hour-rain > .glyph,
.wx-day-rain > .glyph,
.deadline-wx-rain > .glyph,
.bg-editor-head-premium > .glyph,
.bg-preset-lock-overlay .glyph,
.settings-sub-credits > .glyph,
.settings-wx-place > .glyph,
.detail-title > .glyph,
.board-empty-glyph > .glyph {
    margin-block: -0.2em;
}

/* The pet's egg in place of the egg emoji: the same drawing PetGlyph shows, sized
   1em by .pet-art (32-pet-art.css) inside wrappers that set line-height: 1. Seated
   at the top of that line it fills it exactly, where the middle alignment would
   push the line a few pixels taller than the emoji's. */
.glyph.pet-art {
    vertical-align: top;
}

/* The confirm card centres its children, but a block image does not centre
   itself inside the icon slot. */
.confirm-icon > .glyph {
    margin-inline: auto;
}

/* The streak flame. fire.svg is a portrait drawing (500x690), so its box takes
   that shape instead of the square: as tall as the emoji flame painted, sized
   off .hero-streak-fire's font-size (24px in the hero, 14px in the shop
   preview). The negative block margin keeps the margin box at 1.15em, under the
   number's own line at every size, so the streak block keeps its height.
   The emoji also took the number's dark text-shadow, which keeps it readable on
   a light hero (the common tier's grey); an image ignores text-shadow, so the
   same contour comes back as a filter. */
.hero-streak-fire > .glyph {
    width: 1em;
    height: 1.35em;
    margin-block: -0.1em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
