:root {
  --gl-cyan: #00d8d8;
  --gl-cyan-hi: #baffff;
  --gl-bone: #e2d8bd;
  --gl-void: #a68cff;
  --gl-stone: #242a31;
  --gl-deep: #0b0f14;
}

[hidden] { display: none !important; }

.gl-shell {
  max-width: 1240px;
  color: #d9e5e6;
}

.gl-tagline {
  margin: .25rem 0 1rem;
  color: #a6c6c8;
  text-align: center;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.gl-lobby,
.gl-play {
  position: relative;
  overflow: hidden;
  border: 1px solid #176e75;
  background:
    linear-gradient(rgba(6, 10, 14, .2), rgba(6, 10, 14, .84)),
    url('/minigames/graveleap/images/lobby-crossing.png') center/cover;
  box-shadow: 0 0 34px rgba(0, 204, 204, .14), inset 0 0 70px #000;
}

.gl-lobby { padding: 1rem clamp(.65rem, 2.5vw, 2rem) 2rem; }

.gl-wordmark {
  display: block;
  width: min(720px, 92%);
  height: auto;
  margin: 0 auto .4rem;
  image-rendering: pixelated;
}

.gl-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  max-width: 920px;
  margin: 0 auto 1rem;
}

.gl-mode {
  position: relative;
  min-height: 128px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #52616b;
  background: #121820;
  color: #cbd9da;
  box-shadow: inset 0 0 20px #000;
  cursor: url('/images/cursors/hover.cur') 11 0, url('/images/cursors/hover.png') 11 0, pointer;
}

.gl-mode img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: .64;
}

.gl-mode strong,
.gl-mode span {
  position: absolute;
  left: .35rem;
  right: .35rem;
  text-shadow: 0 2px 3px #000, 0 0 8px #000;
}

.gl-mode strong { bottom: 1.45rem; color: #e6f8f8; font-size: 1rem; }
.gl-mode span { bottom: .3rem; color: #91aeb0; font-size: .73rem; }
.gl-mode:hover,
.gl-mode:focus-visible,
.gl-mode.is-active { border-color: var(--gl-cyan); box-shadow: 0 0 14px rgba(0, 216, 216, .35); }
.gl-mode.is-active img { opacity: 1; }
.gl-mode.is-active strong { color: var(--gl-cyan-hi); }

.gl-panel {
  max-width: 1080px;
  min-height: 330px;
  margin: auto;
  padding: 1rem;
  border: 1px solid rgba(0, 204, 204, .35);
  background: rgba(5, 9, 13, .84);
  box-shadow: inset 0 0 42px #000;
}

.gl-challengers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .55rem;
}

.gl-challenger {
  padding: .35rem;
  border: 1px solid #48525e;
  background: #10151b;
  color: #c6d0d1;
  cursor: url('/images/cursors/hover.cur') 11 0, url('/images/cursors/hover.png') 11 0, pointer;
}

.gl-challenger img {
  display: block;
  width: 100%;
  height: min(190px, 18vw);
  object-fit: cover;
  object-position: center top;
  image-rendering: pixelated;
  filter: saturate(.7) brightness(.78);
}

.gl-challenger strong,
.gl-challenger span { display: block; }
.gl-challenger strong { margin-top: .3rem; font-size: .88rem; }
.gl-challenger span { color: #7fa4a7; font-size: .7rem; }
.gl-challenger:hover,
.gl-challenger:focus-visible,
.gl-challenger.is-active { border-color: var(--gl-cyan); color: var(--gl-cyan-hi); }
.gl-challenger.is-active img { filter: none; }

.gl-blurb,
.gl-note,
.gl-status { text-align: center; color: #a8c4c6; }

.gl-start-row {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.gl-start-row label,
.gl-summons-form > label {
  display: grid;
  gap: .25rem;
  color: #b9d2d4;
  font-size: .8rem;
}

.gl-start-row label span { color: #7d999b; }

.gl-shell input {
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid #3c777b;
  border-radius: 0;
  background: #080d12;
  color: #eaffff;
  font: inherit;
  padding: .55rem .65rem;
}

.gl-shell button {
  border-radius: 0;
  font-family: "Cinzel", serif;
}

.gl-primary,
.gl-continue,
.gl-summons-actions button,
.gl-play-controls button,
.gl-result button {
  min-height: 42px;
  padding: .55rem .9rem;
  border: 1px solid #008f96;
  background: linear-gradient(#15343a, #09191d);
  color: var(--gl-cyan-hi);
  cursor: url('/images/cursors/hover.cur') 11 0, url('/images/cursors/hover.png') 11 0, pointer;
}

.gl-primary:hover,
.gl-primary:focus-visible,
.gl-continue:hover,
.gl-continue:focus-visible,
.gl-summons-actions button:hover,
.gl-summons-actions button:focus-visible,
.gl-play-controls button:hover,
.gl-play-controls button:focus-visible {
  border-color: #7fffff;
  box-shadow: 0 0 12px rgba(0, 255, 255, .25);
}

.gl-continue { display: block; margin: 1rem auto 0; }

.gl-name-pair {
  display: grid;
  grid-template-columns: minmax(170px, 240px) auto minmax(170px, 240px);
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.6rem auto;
}

.gl-name-pair label { display: grid; gap: .35rem; text-align: center; }
.gl-name-pair img { margin: auto; image-rendering: pixelated; }
.gl-name-pair b { color: var(--gl-cyan); font-size: 1.4rem; }
#panel-hotseat > .gl-primary { display: block; margin: auto; }

.gl-summons-form { max-width: 760px; margin: 2rem auto; }
.gl-summons-actions { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.gl-code-input { width: 8rem; text-transform: uppercase; letter-spacing: .2em; font-weight: bold; }

.gl-play {
  padding: 1rem;
  background:
    linear-gradient(rgba(5, 8, 12, .45), rgba(5, 8, 12, .8)),
    url('/minigames/graveleap/images/play-backdrop.png') center/cover;
}

.gl-play-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .65rem;
}

.gl-play-heading > div:first-child { display: grid; gap: .2rem; }
#gameMode { color: #86a5a8; text-transform: uppercase; font-size: .72rem; letter-spacing: .12em; }
.gl-turn { color: var(--gl-cyan-hi); }
.gl-turn.is-void { color: #c8baff; }
.gl-play-controls { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: end; }

.gl-summons-banner {
  margin: 0 auto .65rem;
  padding: .45rem;
  border: 1px solid #7763bd;
  background: rgba(35, 24, 70, .8);
  text-align: center;
}
.gl-summons-banner strong { color: #d7ccff; letter-spacing: .18em; }

.gl-table {
  display: grid;
  grid-template-columns: minmax(120px, .35fr) minmax(360px, 760px) minmax(120px, .35fr);
  gap: .8rem;
  align-items: center;
  justify-content: center;
}

.gl-board-wrap {
  width: 100%;
  max-width: 760px;
  aspect-ratio: 1;
  padding: 5.55%;
  box-sizing: border-box;
  background: url('/minigames/graveleap/images/board-plate.png') center/100% 100% no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 14px #000);
}

.gl-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  height: 100%;
}

.gl-square {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.gl-square.is-dark {
  cursor: url('/images/cursors/hover.cur') 11 0, url('/images/cursors/hover.png') 11 0, pointer;
}

.gl-square img {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 3px rgba(0, 0, 0, .65));
  transition: transform .12s ease, filter .12s ease;
  pointer-events: none;
}

.gl-square.can-select::after,
.gl-square.is-target::after,
.gl-square.is-selected::after,
.gl-square.was-moved::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

.gl-square.can-select::after { inset: 31%; border: 2px solid rgba(0, 245, 245, .6); transform: rotate(45deg); }
.gl-square.is-target::after { inset: 26%; border: 3px solid #8fffff; border-radius: 50%; box-shadow: 0 0 12px #00ffff; }
.gl-square.is-selected::after { inset: 6%; border: 3px solid #fff3b2; box-shadow: inset 0 0 12px #e7aa2c; }
.gl-square.was-moved::before { inset: 9%; border: 2px solid rgba(168, 133, 255, .52); }
.gl-square.can-select:hover img { transform: translateY(-7%); filter: drop-shadow(0 8px 5px #000) brightness(1.14); }

.gl-side {
  display: grid;
  justify-items: center;
  gap: .25rem;
  min-width: 0;
  padding: .75rem .25rem;
  border: 1px solid #36434c;
  background: rgba(7, 11, 16, .82);
  text-align: center;
  overflow-wrap: anywhere;
}

.gl-side img { width: min(96px, 75%); height: auto; image-rendering: pixelated; }
.gl-side--bone strong { color: var(--gl-bone); }
.gl-side--void strong { color: #c9bdff; }
.gl-side span,
.gl-side small { color: #8ca6a8; }
.gl-status { min-height: 1.6em; margin-bottom: 0; }

.gl-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 640px;
  margin: 1rem auto 0;
  padding: 1rem;
  border: 1px solid #c6a756;
  background: rgba(12, 12, 12, .94);
  box-shadow: 0 0 25px rgba(221, 182, 84, .22);
}

.gl-result img { image-rendering: pixelated; }
.gl-result h2 { margin: 0; color: #f0d98e; }

.gl-divider {
  margin: 2rem 0 1.25rem;
  border: 0;
  border-top: 1px solid rgba(0, 204, 204, .42);
}

.gl-leaderboard h2 { color: var(--gl-cyan-hi); }
.gl-leaderboard > p { color: #91adaf; }
.gl-table-scroll { overflow-x: auto; }
#lbTable { width: 100%; border-collapse: collapse; border: 1px solid #008b8b; }
#lbTable th,
#lbTable td { padding: .55rem; border: 1px solid #008b8b; text-align: left; }
#lbTable th { background: rgba(0, 204, 204, .14); color: #aefefe; }
#lbTable .empty-cell { color: #82999b; font-style: italic; text-align: center; }

@media (max-width: 850px) {
  .gl-modes { grid-template-columns: 1fr; }
  .gl-mode { min-height: 88px; }
  .gl-mode img { height: 86px; }
  .gl-challengers { grid-template-columns: repeat(5, minmax(105px, 1fr)); overflow-x: auto; padding-bottom: .4rem; }
  .gl-challenger img { height: 130px; }
  .gl-table { grid-template-columns: 1fr 1fr; }
  .gl-board-wrap { grid-column: 1 / -1; grid-row: 1; max-width: 680px; justify-self: center; }
  .gl-side { grid-row: 2; grid-template-columns: auto 1fr; justify-items: start; text-align: left; }
  .gl-side img { grid-row: 1 / 3; width: 58px; }
}

@media (max-width: 560px) {
  .gl-shell { padding-left: .35rem; padding-right: .35rem; }
  .gl-lobby,
  .gl-play { padding: .5rem; }
  .gl-panel { padding: .55rem; }
  .gl-play-heading { align-items: flex-start; flex-direction: column; }
  .gl-play-controls { justify-content: start; }
  .gl-play-controls button { min-height: 38px; padding: .4rem .5rem; font-size: .72rem; }
  .gl-table { gap: .35rem; }
  .gl-board-wrap { padding: 5.55%; }
  .gl-name-pair { grid-template-columns: 1fr; }
  .gl-name-pair b { transform: rotate(90deg); }
  .gl-result { align-items: flex-start; }
  .gl-result img { width: 80px; height: 80px; }
}
