/* Gridlock — a crowded shelf of illuminated blocks, one gilded chest. */

[hidden] { display: none !important; }

.gl-frame {
  width: min(560px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(10px, 2.2vw, 18px);
}
.deal-line {
  margin: 0;
  text-align: center;
  font-family: var(--hand);
  font-style: italic;
  font-size: clamp(14px, 2.1vw, 16.5px);
  color: var(--ink-soft);
  min-height: 1.4em;
}
.deal-line b { color: var(--oxblood); font-weight: 600; }

/* ---- the shelf ---- */
.shelf-wrap { position: relative; }
.shelf {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  background:
    linear-gradient(rgba(122, 104, 80, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 104, 80, .16) 1px, transparent 1px),
    linear-gradient(180deg, var(--cream), #efe3c2);
  background-size: calc(100% / 6) calc(100% / 6), calc(100% / 6) calc(100% / 6), 100% 100%;
  box-shadow: inset 0 0 0 2px rgba(58, 48, 36, .7), 0 3px 10px rgba(0, 0, 0, .25);
  touch-action: none;
  overflow: visible;
}
.exit-notch {
  position: absolute;
  right: -7px;
  top: calc(100% / 6 * 2 + 2%);
  height: calc(100% / 6 - 4%);
  width: 7px;
  border-radius: 0 4px 4px 0;
  background: rgba(31, 26, 18, .85);
  box-shadow: inset 0 0 0 1px rgba(227, 183, 84, .6);
}

.piece {
  position: absolute;
  border-radius: 8px;
  border: none;
  padding: 0;
  cursor: grab;
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #d8c49a, #c2ab7d);
  box-shadow: inset 0 0 0 1.5px rgba(94, 75, 45, .65), 0 3px 8px rgba(0, 0, 0, .3);
  transition: left .16s var(--ease), top .16s var(--ease);
}
.piece.dragging { transition: none; cursor: grabbing; z-index: 4; }
.piece.v {
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #b9a67c, #a3906a);
}
.piece.key {
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #e3b754, #c8963a);
  box-shadow: inset 0 0 0 2px rgba(94, 63, 15, .8), 0 4px 10px rgba(0, 0, 0, .35);
}
.piece.key::after {
  content: '✦';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(94, 27, 32, .85);
  font-size: clamp(14px, 2.6vw, 20px);
}
.piece.sel { outline: 2.5px solid rgba(227, 183, 84, .95); outline-offset: 1px; }
.piece.hint-flash { animation: gl-hint 1s ease 2; }
@keyframes gl-hint {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.25) drop-shadow(0 0 8px rgba(122, 176, 132, .9)); }
}

.frame-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.help-body { text-align: left; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.help-body p { margin: 0 0 12px; }
.help-body b { color: var(--oxblood); }

.new-best {
  display: inline-block;
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11.5px;
  color: var(--parchment);
  background: var(--oxblood);
  border-radius: 5px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
