html { height: 100%; } body { font-size: 24px; min-height: 100%; margin: 0; display: flex; justify-content: center; align-items: center; background: #606060; } main { display: grid; grid: "level meta" min-content "level nav" min-content "level chips" min-content "level time" min-content "level hint" 1fr "level inventory" min-content / min-content 12em ; gap: 1em; image-rendering: optimizeSpeed; --tile-width: 32px; --tile-height: 32px; --scale: 2; } .level { grid-area: level; position: relative; } .level canvas { display: block; width: calc(9 * var(--tile-width) * var(--scale)); } .meta { grid-area: meta; color: yellow; background: black; text-align: center; } .nav { grid-area: nav; display: flex; gap: 1em; } .nav .nav-browse { flex: 1; } .chips { grid-area: chips; padding: 0 0.5em; color: yellow; background: black; } .chips::before { content: "chips left: "; } .time { grid-area: time; } .hint { grid-area: hint; } .inventory { grid-area: inventory; display: flex; flex-wrap: wrap; align-items: start; background-size: calc(2 * var(--tile-width)) calc(2 * var(--tile-height)); width: calc(4 * var(--tile-width) * 2); min-height: calc(2 * var(--tile-height) * 2); } .inventory img { width: calc(2 * var(--tile-width)); } .bummer { grid-area: level; display: flex; justify-content: center; align-items: center; z-index: 99; font-size: 48px; padding: 25%; background: #0009; color: white; text-align: center; font-weight: bold; text-shadow: 0 2px 1px black; } .bummer:empty { display: none; }