/* Converted from LESS source files - stratego.io */

/* === variables (resolved) ===
   @mobile-width: 480px
   @grid-border-color: rgba(0, 0, 0, 0.2)
   @highlight: rgba(0, 0, 0, 0.05)
   @dark-highlight: rgba(0, 0, 0, 0.25)
   @panel-color: rgb(0, 0, 0)
   lighten(@panel-color, 5%) = #0d0d0d
   lighten(@panel-color, 10%) = #1a1a1a
*/

/* === styles.less === */

body {
  font-family: "Open Sans";
  margin: 0;
}

body.pace-done {
  background-color: rgb(94, 181, 73);
}

a {
  color: white;
  text-decoration: none;
}

#preload {
  display: none;
}

.board-view {
  background-size: contain;
  position: absolute;
}

.board-view .content-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.overlay-graphic-view {
  position: absolute;
  background-size: contain;
  z-index: 1;
}

.overlay-graphic-view.grass1,
.overlay-graphic-view.grass2 {
  z-index: 0;
}

.vertical-align {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 870px) {
  .fork-me {
    display: none;
  }
}

/* === cell.less === */

.cell {
  opacity: 0.7;
}

.cell.last-move-from {
  background: rgba(0, 0, 0, 0.05);
}

.cell.last-move-to {
  background: rgba(0, 0, 0, 0.25);
}

.cell.selected {
  background: rgba(0, 0, 0, 0.25);
}

.cell.drag-hover,
.cell.hover {
  background: rgba(0, 0, 0, 0.05);
}

.piece {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-size: 70%;
  background-position: 50% 70%;
}

.piece[data-rank='B'],
.piece[data-rank='F'],
.piece[data-rank='U'] {
  background-position: 50%;
}

.piece-rank,
.dead-piece-rank {
  position: absolute;
  top: 5%;
  background-size: 100%;
  z-index: 0;
  width: 30%;
  height: 30%;
}

.piece-rank {
  left: 5%;
}

.dead-piece-rank {
  right: 5%;
}

.phantom {
  opacity: 0.2;
}

/* === game.less === */

.game-view {
  width: 100%;
  height: 100%;
}

.game-view .setup-panel {
  width: 95%;
  height: 55%;
  top: 1.25%;
}

.game-view .horizontal-grid-line {
  width: 100%;
  height: 1px;
  position: absolute;
  background: rgba(0, 0, 0, 0.2);
}

.game-view .horizontal-grid-line[data-number="0"] { top: 10%; }
.game-view .horizontal-grid-line[data-number="1"] { top: 20%; }
.game-view .horizontal-grid-line[data-number="2"] { top: 30%; }
.game-view .horizontal-grid-line[data-number="3"] { top: 40%; }
.game-view .horizontal-grid-line[data-number="4"] { top: 50%; }
.game-view .horizontal-grid-line[data-number="5"] { top: 60%; }
.game-view .horizontal-grid-line[data-number="6"] { top: 70%; }
.game-view .horizontal-grid-line[data-number="7"] { top: 80%; }
.game-view .horizontal-grid-line[data-number="8"] { top: 90%; }

.game-view .vertical-grid-line {
  width: 1px;
  height: 100%;
  position: absolute;
  background: rgba(0, 0, 0, 0.2);
}

.game-view .vertical-grid-line[data-number="0"] { left: 10%; }
.game-view .vertical-grid-line[data-number="1"] { left: 20%; }
.game-view .vertical-grid-line[data-number="2"] { left: 30%; }
.game-view .vertical-grid-line[data-number="3"] { left: 40%; }
.game-view .vertical-grid-line[data-number="4"] { left: 50%; }
.game-view .vertical-grid-line[data-number="5"] { left: 60%; }
.game-view .vertical-grid-line[data-number="6"] { left: 70%; }
.game-view .vertical-grid-line[data-number="7"] { left: 80%; }
.game-view .vertical-grid-line[data-number="8"] { left: 90%; }

.game-view .grid-container {
  position: absolute;
  width: 100%;
  height: 100%;
}

.game-view .grid-container .cell {
  position: absolute;
  width: 10%;
  height: 10%;
}

.game-view .grid-container .cell[data-y="0"] { top: 0%; }
.game-view .grid-container .cell[data-y="1"] { top: 10%; }
.game-view .grid-container .cell[data-y="2"] { top: 20%; }
.game-view .grid-container .cell[data-y="3"] { top: 30%; }
.game-view .grid-container .cell[data-y="4"] { top: 40%; }
.game-view .grid-container .cell[data-y="5"] { top: 50%; }
.game-view .grid-container .cell[data-y="6"] { top: 60%; }
.game-view .grid-container .cell[data-y="7"] { top: 70%; }
.game-view .grid-container .cell[data-y="8"] { top: 80%; }
.game-view .grid-container .cell[data-y="9"] { top: 90%; }

.game-view .grid-container .cell[data-x="0"] { left: 0%; }
.game-view .grid-container .cell[data-x="1"] { left: 10%; }
.game-view .grid-container .cell[data-x="2"] { left: 20%; }
.game-view .grid-container .cell[data-x="3"] { left: 30%; }
.game-view .grid-container .cell[data-x="4"] { left: 40%; }
.game-view .grid-container .cell[data-x="5"] { left: 50%; }
.game-view .grid-container .cell[data-x="6"] { left: 60%; }
.game-view .grid-container .cell[data-x="7"] { left: 70%; }
.game-view .grid-container .cell[data-x="8"] { left: 80%; }
.game-view .grid-container .cell[data-x="9"] { left: 90%; }

/* === setup.less === */

.setup-view {
  width: 100%;
  height: 100%;
}

.setup-view .panel {
  width: 95%;
  height: 57.5%;
  top: 1.25%;
}

.setup-view .panel .panel-textbox {
  font-size: 13px;
}

.setup-view .horizontal-grid-line {
  width: 100%;
  height: 1px;
  position: absolute;
  background-color: rgba(0, 0, 0, 0.2);
}

.setup-view .horizontal-grid-line[data-number="0"] { top: 25%; }
.setup-view .horizontal-grid-line[data-number="1"] { top: 50%; }
.setup-view .horizontal-grid-line[data-number="2"] { top: 75%; }

.setup-view .vertical-grid-line {
  width: 1px;
  height: 100%;
  position: absolute;
  background-color: rgba(0, 0, 0, 0.2);
}

.setup-view .vertical-grid-line[data-number="0"] { left: 10%; }
.setup-view .vertical-grid-line[data-number="1"] { left: 20%; }
.setup-view .vertical-grid-line[data-number="2"] { left: 30%; }
.setup-view .vertical-grid-line[data-number="3"] { left: 40%; }
.setup-view .vertical-grid-line[data-number="4"] { left: 50%; }
.setup-view .vertical-grid-line[data-number="5"] { left: 60%; }
.setup-view .vertical-grid-line[data-number="6"] { left: 70%; }
.setup-view .vertical-grid-line[data-number="7"] { left: 80%; }
.setup-view .vertical-grid-line[data-number="8"] { left: 90%; }

.setup-view .grid-container {
  width: 100%;
  height: 40%;
  top: 60%;
  position: relative;
}

.setup-view .grid-container .cell {
  position: absolute;
  width: 10%;
  height: 25%;
}

.setup-view .grid-container .cell[data-y="0"] { top: 0%; }
.setup-view .grid-container .cell[data-y="1"] { top: 25%; }
.setup-view .grid-container .cell[data-y="2"] { top: 50%; }
.setup-view .grid-container .cell[data-y="3"] { top: 75%; }

.setup-view .grid-container .cell[data-x="0"] { left: 0%; }
.setup-view .grid-container .cell[data-x="1"] { left: 10%; }
.setup-view .grid-container .cell[data-x="2"] { left: 20%; }
.setup-view .grid-container .cell[data-x="3"] { left: 30%; }
.setup-view .grid-container .cell[data-x="4"] { left: 40%; }
.setup-view .grid-container .cell[data-x="5"] { left: 50%; }
.setup-view .grid-container .cell[data-x="6"] { left: 60%; }
.setup-view .grid-container .cell[data-x="7"] { left: 70%; }
.setup-view .grid-container .cell[data-x="8"] { left: 80%; }
.setup-view .grid-container .cell[data-x="9"] { left: 90%; }

/* === panel.less === */

.panel {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  padding: 0;
  opacity: 0.88;
  background: rgb(0, 0, 0);
  border: 1px solid #1a1a1a;
  border-radius: 5px;
  color: white;
  overflow-y: auto;
}

button.panel-option {
  width: 100%;
  text-align: left;
  font: inherit;
}

.panel-option {
  display: block;
  padding: 20px;
  background: #0d0d0d;
  border: 0;
  margin-bottom: 10px;
  color: white;
  cursor: pointer;
}

@media (max-width: 480px), (max-height: 480px) {
  .panel-option {
    padding: 5px;
  }
}

.panel-option:hover {
  background: #1a1a1a;
}

.panel-option .title {
}

.panel-option .description {
  font-size: 11px;
}

.panel-textbox {
  width: 100%;
  text-align: center;
}

.panel-textbox a {
  text-decoration: underline;
}

a.commit-link {
  text-decoration: none;
  color: inherit;
}

.version-info {
  font-size: 10px;
  opacity: 0.5;
  padding-bottom: 8px;
}


/* === home.less === */

.home-view.panel {
  width: 80%;
  max-height: 90%;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 600px), (max-height: 600px) {
  .home-view.panel {
    width: 90%;
  }
}

@media (max-width: 480px), (max-height: 480px) {
  .home-view.panel {
    padding: 0;
    width: 95%;
    max-height: 95%;
  }
}

/* === loading.less === */

.loading-view {
  position: absolute;
  width: 100%;
  top: 30%;
}

.loading-view .spinner-container {
  position: relative;
  height: 100px;
  text-align: center;
}

.loading-view .loading-html {
  text-align: center;
  color: white;
}

/* === attack.less === */

.attack-panel .attacker,
.attack-panel .attackee,
.attack-panel .middle {
  float: left;
  height: 100%;
  text-align: center;
}

.attack-panel .attacker,
.attack-panel .attackee {
  width: 40%;
}

.attack-panel .attacker .piece,
.attack-panel .attackee .piece {
  width: 100%;
  height: 70%;
}

.attack-panel .middle {
  width: 20%;
}

.attack-panel .middle .versus {
  color: white;
}

/* === grid.less === */

.grid-view {
  width: 100%;
  height: 100%;
}

/* === CSS spinner (replaces Spin.js) === */

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === connection indicator === */

.ws-indicator {
  position: fixed;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-family: "Open Sans", sans-serif;
  color: white;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ws-indicator.ws-idle {
  display: none;
}

.ws-indicator .ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ws-indicator .ws-label {
  white-space: nowrap;
}

.ws-indicator.ws-connected {
  background: transparent;
  animation: ws-fade-in-out 3s ease forwards;
}

.ws-indicator.ws-connected .ws-dot {
  background: #4caf50;
  box-shadow: 0 0 4px #4caf50;
}

@keyframes ws-fade-in-out {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.ws-indicator.ws-disconnected {
  background: rgba(0, 0, 0, 0.85);
}

.ws-indicator.ws-disconnected .ws-dot {
  background: #f44336;
  box-shadow: 0 0 4px #f44336;
}

.ws-indicator.ws-reconnecting {
  background: rgba(0, 0, 0, 0.85);
}

.ws-indicator.ws-reconnecting .ws-dot {
  background: #ff9800;
  box-shadow: 0 0 4px #ff9800;
  animation: ws-pulse 1.2s ease-in-out infinite;
}

@keyframes ws-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

@media (max-width: 480px), (max-height: 480px) {
  .ws-indicator {
    bottom: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 11px;
  }
}
