/* Keep the chunky display face loud without letting the two title lines collide. */
.title-screen h1 {
  line-height: .84;
  letter-spacing: -.02em;
}

.title-actions button:disabled {
  cursor: wait;
  opacity: .48;
}

.journal-toggle {
  position: absolute;
  right: 14px;
  top: 52px;
  z-index: 3;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  background: var(--acid);
  box-shadow: 4px 4px 0 rgba(23, 23, 19, .3);
  font-size: 8px;
  letter-spacing: .09em;
  cursor: pointer;
}

.inventory-toggle {
  position: absolute;
  right: 14px;
  top: 88px;
  z-index: 3;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  background: var(--sun);
  box-shadow: 4px 4px 0 rgba(23, 23, 19, .3);
  font-size: 8px;
  letter-spacing: .09em;
  cursor: pointer;
}

.journal-toggle.is-unread {
  background: #d98274;
}

.journal-toggle.is-flashing {
  animation: quest-update-flash .55s steps(2, end) infinite;
}

@keyframes quest-update-flash {
  0%, 100% {
    background: #d98274;
    box-shadow: 4px 4px 0 rgba(23, 23, 19, .3);
  }

  50% {
    background: var(--paper);
    box-shadow: 4px 4px 0 var(--ink), 0 0 0 5px #d98274;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journal-toggle.is-flashing {
    animation: none;
    outline: 5px solid #d98274;
    outline-offset: 3px;
  }
}

.shop,
.dialogue,
.inventory,
.paint-studio {
  z-index: 4;
}

/* Every scene uses one permanent, centered location card. */
.place-label {
  left: 50%;
  right: auto;
  top: 14px;
  min-width: 220px;
  padding: 9px 24px;
  translate: -50% 0;
  text-align: center;
  white-space: nowrap;
  z-index: 3;
}

.paint-studio {
  position: absolute;
  inset: 16px;
  overflow: hidden;
  padding: 18px 22px 20px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 11px 11px 0 var(--ink);
}

.paint-studio header p {
  margin: 0;
  font-size: 8px;
  letter-spacing: .12em;
}

.paint-studio header h2 {
  margin: 5px 42px 12px 0;
  font: 400 25px/1 var(--display);
  letter-spacing: .025em;
}

.paint-close {
  position: absolute;
  right: 12px;
  top: 8px;
  border: 0;
  background: none;
  font-size: 28px;
  cursor: pointer;
}

.paint-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(290px, 340px);
  gap: 18px;
  height: calc(100% - 62px);
  min-height: 0;
}

.paint-canvas-wrap {
  display: grid;
  min-height: 0;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 10px;
  border: 3px solid var(--ink);
  background: #b9bab1;
}

#paul-art-canvas {
  display: block;
  width: min(100%, 512px, calc(100vh - 190px));
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  background: var(--paper);
  cursor: crosshair;
  touch-action: none;
}

.paint-canvas-wrap > small,
.paint-controls small {
  font-size: 7px;
  line-height: 1.4;
  letter-spacing: .06em;
}

.paint-controls {
  min-height: 0;
  overflow: auto;
  padding-right: 5px;
}

.paint-controls section {
  margin-bottom: 11px;
}

.paint-controls section > b,
.paint-text-options label {
  display: block;
  margin-bottom: 6px;
  font-size: 8px;
  letter-spacing: .1em;
}

.paint-tool-grid,
.paint-size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.paint-tool-grid button,
.paint-size-grid button,
.paint-submit {
  min-height: 32px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 7px;
  letter-spacing: .05em;
  cursor: pointer;
}

.paint-tool-grid button[aria-pressed="true"],
.paint-size-grid button[aria-pressed="true"] {
  background: var(--acid);
  box-shadow: 3px 3px 0 var(--ink);
}

.paint-text-options input {
  width: 100%;
  margin-bottom: 5px;
  padding: 8px;
  border: 2px solid var(--ink);
  background: #fff;
  font: 500 11px var(--mono);
}

.paint-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.paint-swatch {
  aspect-ratio: 1;
  min-width: 20px;
  padding: 0;
  border: 2px solid var(--ink);
  cursor: pointer;
}

.paint-swatch[aria-pressed="true"] {
  outline: 3px solid var(--acid);
  outline-offset: 1px;
}

.paint-submit {
  width: 100%;
  margin: 2px 0 7px;
  padding: 10px;
  background: var(--red);
  color: var(--paper);
  font-weight: 500;
}

.paint-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .paint-studio {
    inset: 8px 8px 76px;
    overflow: auto;
  }

  .paint-workbench {
    grid-template-columns: 1fr;
    height: auto;
  }

  #paul-art-canvas {
    width: min(100%, 430px);
  }
}

.shop h2 {
  max-width: 340px;
  font-size: 31px;
  letter-spacing: .025em;
}

.shop-item small {
  max-width: 255px;
  line-height: 1.45;
}

.shop-copy-with-preview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.shop-nft-preview {
  width: 96px;
  height: 72px;
  border: 3px solid var(--ink);
  background: var(--blue);
  image-rendering: auto;
}

.inventory {
  position: absolute;
  left: 20px;
  top: 20px;
  bottom: 20px;
  width: min(510px, calc(100% - 40px));
  overflow: auto;
  padding: 24px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 11px 11px 0 var(--ink);
}

.inventory > p {
  margin: 0;
  font-size: 9px;
  letter-spacing: .12em;
}

.inventory h2 {
  max-width: 430px;
  margin: 12px 0 22px;
  font: 400 32px/1.04 var(--display);
  letter-spacing: .025em;
}

.inventory-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  background: none;
  font-size: 28px;
  cursor: pointer;
}

.inventory-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 55px;
  padding: 10px 0;
  border-top: 2px solid var(--ink);
}

.inventory-item strong,
.inventory-item small {
  display: block;
}

.inventory-item small {
  margin-top: 4px;
  font-size: 7px;
  letter-spacing: .08em;
}

.inventory-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.inventory-actions b,
.inventory-resource > b {
  font: 400 18px var(--display);
}

.inventory-actions button {
  padding: 7px 8px;
  border: 2px solid var(--ink);
  background: var(--acid);
  font-size: 7px;
  letter-spacing: .06em;
  cursor: pointer;
}

.inventory-actions button:disabled {
  background: var(--sun);
  opacity: .75;
}

.inventory-tezpole-loadout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 13px;
  border: 3px solid var(--ink);
  background: #d7d7cd;
  box-shadow: 5px 5px 0 var(--ink);
}

.inventory-tezpole-loadout strong,
.inventory-tezpole-loadout small {
  display: block;
}

.inventory-tezpole-loadout strong {
  font: 400 17px var(--display);
  letter-spacing: .04em;
}

.inventory-tezpole-loadout small {
  margin-top: 5px;
  max-width: 280px;
  font-size: 7px;
  line-height: 1.45;
  letter-spacing: .07em;
}

.inventory-tezpole-loadout [data-ready="true"] {
  color: #23632e;
}

.inventory > small {
  display: block;
  margin-top: 18px;
  font-size: 8px;
  line-height: 1.55;
}

.dialogue-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialogue-heading [data-dialogue-quests] {
  max-width: 62%;
  padding: 5px 7px;
  background: #d98274;
  border: 2px solid var(--ink);
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: .07em;
  text-align: right;
}

.journal {
  position: absolute;
  z-index: 4;
  left: 20px;
  top: 20px;
  bottom: 20px;
  width: min(470px, calc(100% - 40px));
  overflow: auto;
  padding: 24px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 11px 11px 0 var(--ink);
}

.journal > p {
  margin: 0;
  font-size: 9px;
  letter-spacing: .12em;
}

.journal h2 {
  margin: 12px 0 22px;
  font: 400 36px/1 var(--display);
}

.journal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  background: none;
  font-size: 28px;
  cursor: pointer;
}

.journal-items article {
  padding: 13px 0;
  border-top: 2px solid var(--ink);
}

.journal-items article[data-status="complete"] {
  opacity: .58;
}

.journal-items article > span {
  display: inline-block;
  padding: 3px 5px;
  background: var(--sun);
  font-size: 7px;
  letter-spacing: .1em;
}

.journal-items article[data-status="active"] > span {
  background: var(--red);
  color: var(--paper);
}

.journal-items article[data-status="daily"] > span {
  background: var(--blue);
}

.journal-items h3 {
  margin: 8px 0 5px;
  font: 400 17px/1.2 var(--display);
}

.journal-items p,
.journal > small {
  font-size: 9px;
  line-height: 1.6;
}

.journal > small {
  display: block;
  margin-top: 16px;
}

.touch-pad {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(2, 48px);
  gap: 3px;
  pointer-events: auto;
}

.touch-pad button {
  width: 48px;
  height: 48px;
}

.touch-pad button[data-touch="up"] {
  grid-column: 2;
}

.touch-pad button[data-touch="left"] {
  grid-column: 1;
}

.touch-pad button[data-touch="down"] {
  grid-column: 2;
}

.touch-pad button[data-touch="right"] {
  grid-column: 3;
}

@media (max-height: 800px) {
  .title-screen {
    padding: 22px 6vw;
    place-content: center start;
  }

  .title-screen h1 {
    margin: 7px 0 8px;
    font-size: clamp(4.5rem, 18vh, 7.5rem);
  }

  .title-screen > p:not(.eyebrow):not(.wallet-status) {
    margin: 8px 0;
  }

  .title-actions {
    margin: 10px 0 2px;
  }

  .title-screen > small {
    margin-top: 6px;
  }
}

/* A narrow game window should feel like a camera crop, not a tiny television
   floating in a field of empty letterbox color. */
@media (pointer: coarse), (max-width: 760px) {
  .place-label {
    top: 8px;
    min-width: 0;
    max-width: 52%;
    padding: 7px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hud {
    top: 45px;
  }

  .game-frame canvas {
    position: absolute;
    left: 50%;
    top: 50%;
    width: auto;
    height: 100%;
    max-width: none;
    transform: translate(-50%, -50%);
  }

  .journal-toggle {
    top: 45px;
  }

  .inventory-toggle {
    top: 78px;
  }

  .journal,
  .inventory {
    bottom: 116px;
  }

  .dialogue-heading {
    display: block;
  }

  .dialogue-heading [data-dialogue-quests] {
    display: table;
    max-width: 100%;
    margin-top: 7px;
    text-align: left;
  }
}
