/**
 * The MIT License (MIT)
 *
 * Copyright (C) 2013-2020 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
:root {
  --bg: #09121f;
  --surface: rgba(240, 240, 240, 0.95);
  --cell: rgba(255, 255, 255, 0.04);
  --piece: #707070;
  --piece-shadow: #333333;
  --grid-size: 10;
  --cell-size: 40px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  user-select: none;
}

.app-shell {
  box-sizing: border-box;
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  padding: 24px;
  user-select: none;
}

.grid-container {
  width: min(70vw, 70vh);
  height: min(70vw, 70vh);
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  position: relative;
}

.grid {
  position: relative;
  width: calc(var(--cell-size) * var(--grid-size));
  height: calc(var(--cell-size) * var(--grid-size));
  display: grid;
  grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
  grid-template-rows: repeat(var(--grid-size), minmax(0, 1fr));
  gap: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 75%);
  user-select: none;
}

.grid-cell {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0;
  font-size: calc(var(--cell-size) * 0.75);
  font-weight: 600;
  color: rgba(0, 0, 0, 0.88);
  user-select: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.grid-cell:hover {
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
  user-select: none;
}

.piece {
  position: absolute;
  width: calc(var(--cell-size) * 0.75);
  height: calc(var(--cell-size) * 0.75);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(66, 66, 66, 0.5), rgba(133, 133, 133, 0.5));
  box-shadow: 0 12px 22px var(--piece-shadow);
  transition: transform 0s ease-in-out;
  touch-action: none;
  place-items: center;
  font-size: calc(var(--cell-size) * 0.75);
  font-weight: 600;
  color: transparent;
  display: grid;
  pointer-events: none;
  user-select: none;
}

.piece.at-target {
    color: rgba(0, 0, 0, 0.88);
}

.piece.at-target::after {
    content: "\002730";
}

.piece.moving {
  transition: transform 0s ease-in-out;
}

.piece.dragging {
  z-index: 10;
  opacity: 0.95;
}

.grid.PLAYING .piece {
    pointer-events: auto;
}

.grid.PLAYING .grid-cell {
    pointer-events: auto;
}
