.game-shell {
  position: relative;
  overflow: visible;
}

.side-sigil {
  width: 136px;
  opacity: 0.62;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(0, 255, 255, 0.35));
}

.side-right {
  transform: scaleX(-1);
}

.game-info {
  max-width: 680px;
  margin: 0 auto 18px;
  padding: 12px 16px;
  border: 1px solid #00cccc;
  border-radius: 10px;
  background: rgba(12, 19, 24, 0.88);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.15);
}

.game-info h3 {
  margin: 0 0 8px;
  color: #00dddd;
}

.game-info ul {
  margin: 0;
  padding-left: 20px;
  text-align: left;
}

.name-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 10px;
}

.name-bar label {
  font-size: 0.95rem;
}

.name-bar input[type="text"] {
  width: 220px;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid #007f7f;
  background: #0f1d21;
  color: #e8fafa;
  padding: 8px 12px;
}

.ui-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 12px;
}

.ui-bar label {
  font-size: 0.95rem;
}

.ui-bar select,
.ui-bar button {
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid #007f7f;
  background: #0f1d21;
  color: #e8fafa;
  padding: 8px 12px;
}

.ui-bar button:hover {
  border-color: #00cccc;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.toggle-wrap {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  user-select: none;
  margin-left: 4px;
}

.toggle-wrap input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.toggle-wrap span {
  display: inline-block;
  line-height: 1;
}

.status-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.status-pill {
  border: 1px solid #00a9a9;
  border-radius: 999px;
  padding: 4px 12px;
  background: rgba(6, 26, 32, 0.84);
  min-width: 120px;
}

.board-wrap {
  max-width: 940px;
  margin: 0 auto 16px;
}

.board-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.board {
  width: min(90vw, 594px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  border: 3px solid #00cccc;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.22), inset 0 0 20px rgba(0, 255, 255, 0.08);
}

.board.locked {
  opacity: 0.72;
  filter: saturate(0.75);
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(0, 204, 204, 0.45);
  background: linear-gradient(180deg, rgba(9, 22, 27, 0.9), rgba(5, 13, 17, 0.9));
  color: #ccffff;
  font-size: 0;
  padding: 0;
}

.cell:nth-child(3n) {
  border-right-width: 2px;
}

.cell:nth-child(9n) {
  border-right-width: 1px;
}

.cell.box-bottom {
  border-bottom-width: 2px;
}

.cell.given {
  background: linear-gradient(180deg, rgba(6, 43, 55, 0.94), rgba(3, 27, 35, 0.94));
}

.cell.selected {
  outline: 2px solid #ffd36a;
  z-index: 3;
}

.cell.related {
  background: linear-gradient(180deg, rgba(18, 38, 46, 0.95), rgba(8, 23, 30, 0.95));
}

.cell.error {
  background: linear-gradient(180deg, rgba(70, 20, 20, 0.96), rgba(44, 11, 11, 0.96));
  box-shadow: inset 0 0 10px rgba(255, 50, 50, 0.25);
}

.cell img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(0, 255, 255, 0.35));
}

.cell.given img {
  filter: drop-shadow(0 0 9px rgba(0, 255, 255, 0.6));
}

.rune-legend {
  max-width: 760px;
  margin: 0 auto 14px;
}

.rune-legend h2 {
  margin: 8px 0 10px;
  color: #00dede;
  font-size: 1.2rem;
}

.mobile-rune-hint {
  display: none;
  margin: -2px 0 10px;
  color: #9bdede;
  font-size: 0.88rem;
}

.rune-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
}

.rune-item {
  border: 1px solid #008b8b;
  border-radius: 10px;
  background: rgba(11, 25, 31, 0.84);
  padding: 8px 6px;
}

.rune-key {
  width: 100%;
  font-family: inherit;
  color: #c9ffff;
}

.rune-key:hover:not(:disabled) {
  border-color: #00caca;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.2);
}

.rune-key:disabled {
  opacity: 0.45;
  cursor:
    url('/images/cursors/pointer.cur') 6 0,
    url('/images/cursors/pointer.png') 6 0,
    auto;
}

.rune-item img {
  width: 42px;
  height: 42px;
  display: block;
  margin: 0 auto 6px;
}

.rune-key-label {
  font-size: 0.85rem;
}

.toast {
  min-height: 28px;
  margin: 10px auto 14px;
  max-width: 760px;
  color: #ffc971;
  text-shadow: 0 0 8px rgba(255, 201, 113, 0.35);
}

.leaderboard {
  max-width: 860px;
  margin: 8px auto 0;
}

.leaderboard h2 {
  margin: 10px 0;
  color: #00dede;
  font-size: 1.2rem;
}

#lbTable {
  width: 100%;
  border-collapse: collapse;
  background: rgba(5, 17, 22, 0.86);
  border: 1px solid #008b8b;
}

#lbTable th,
#lbTable td {
  border: 1px solid rgba(0, 139, 139, 0.75);
  padding: 8px 6px;
  font-size: 0.92rem;
}

#lbTable th {
  background: rgba(0, 204, 204, 0.14);
  color: #aefefe;
}

#lbTable .empty-cell {
  color: #8fc8c8;
  font-style: italic;
}

@media (max-width: 980px) {
  .side-sigil {
    display: none;
  }

  .board-wrap {
    max-width: 700px;
  }
}

@media (max-width: 640px) {
  .name-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .name-bar input[type="text"] {
    width: 180px;
  }

  .ui-bar {
    gap: 8px;
  }

  .ui-bar select,
  .ui-bar button {
    padding: 7px 10px;
    font-size: 0.92rem;
  }

  .status-pill {
    min-width: 100px;
    font-size: 0.9rem;
  }

  .mobile-rune-hint {
    display: block;
  }

}

/* Standardized How to Play panel sizing/alignment */
.game-info {
  box-sizing: border-box;
  display: table;
  width: auto;
  max-width: min(94vw, 78ch);
  margin-left: auto;
  margin-right: auto;
  padding: 20px clamp(18px, 3vw, 34px);
}

.game-info h3 {
  text-align: center;
}

.game-info p {
  margin-left: auto;
  margin-right: auto;
  max-width: 72ch;
  text-align: center;
}

.game-info ul {
  box-sizing: border-box;
  width: fit-content;
  max-width: min(100%, 72ch);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.2em;
  text-align: left;
  list-style-position: outside;
}

.game-info li {
  line-height: 1.35;
}

@media (max-width: 700px) {
  .game-info {
    display: block;
    max-width: 95vw;
    padding: 16px;
  }

  .game-info ul {
    width: 100%;
    max-width: 100%;
  }
}

