@theme-color: #1abc9c;
@theme-color-highlighted: #25d3af;
@theme-color-selected: #7ed8c8;
@background-color: #222629;
@empty-color: #151716;
@dark-accent-color: #2e353b;
@warning-red: #9b5c5c;
@red: #cb3939;
@blue: #428dd5;
@grid-color: @theme-color;

@import "core.less";

#game-over-modal {
  --victory-winning-cell-color: @theme-color-highlighted;
}

body {
    color: white;
}

//
// players
//

#other-player-info-row {
    margin-top: 5px;
}

.player-info {
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    border-radius: 6px;
    background-color: @dark-accent-color;
    cursor: default;
    margin-top: 5px;
    box-sizing: border-box;
}

.player-info.my-turn::after {
    display: none !important;
}

#player-0-info, #player-1-info {
    position: relative;
    bottom: 3px;
}

#gear {
    padding-right: 5px;
}

// X / O symbol icon shown next to player names
.symbol-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    margin-right: 2px;
    vertical-align: middle;
    position: relative;

    &.o {
        border-radius: 50%;
        border: solid 3px @blue;
        box-sizing: border-box;
    }

    &.x::before,
    &.x::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: @red;
        border-radius: 2px;
    }
    &.x::before { transform: translateY(-50%) rotate(45deg); }
    &.x::after  { transform: translateY(-50%) rotate(-45deg); }
}

//
// board
//

@cell-dim-lg: 70px;
@cell-dim-xl: 96px;

#board {
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, @cell-dim-lg);
    grid-template-rows: repeat(3, @cell-dim-lg);
    gap: 6px;
    @media(min-width: 992px) {
        grid-template-columns: repeat(3, @cell-dim-xl);
        grid-template-rows: repeat(3, @cell-dim-xl);
        gap: 8px;
    }
    margin-top: 14px;
    margin-bottom: 14px;
    padding: 6px;
    border-radius: 10px;
    background-color: @grid-color;
    @media(min-width: 992px) {
        padding: 8px;
    }
}

.cell {
    background-color: @background-color;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.15s;

    &.hovered {
        background-color: @dark-accent-color;
    }

    // Spectators cannot interact with cells
    body.spectator-mode & {
        cursor: default;
    }
}

@piece-size-ratio: 0.62;
@mark-thickness: 10px;

.piece {
    position: relative;
    height: @piece-size-ratio * @cell-dim-lg;
    width: @piece-size-ratio * @cell-dim-lg;
    @media(min-width: 992px) {
        height: @piece-size-ratio * @cell-dim-xl;
        width: @piece-size-ratio * @cell-dim-xl;
    }
    transition: filter 0.5s, opacity 0.5s;

    // O mark: a ring
    &.o {
        border-radius: 50%;
        border: solid @mark-thickness @blue;
        box-sizing: border-box;
        box-shadow: inset 0 2px 6px -2px rgba(0,0,0,0.5);
    }

    // X mark: two crossing bars
    &.x::before,
    &.x::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        width: 100%;
        height: @mark-thickness;
        background-color: @red;
        border-radius: 4px;
    }
    &.x::before { transform: translateY(-50%) rotate(45deg); }
    &.x::after  { transform: translateY(-50%) rotate(-45deg); }

    &.dim {
        opacity: 0.35;
        filter: grayscale(60%);
    }
}

#spectators-row {
    padding-bottom: 4px;
    @media (max-width: 575.98px) {
        padding-bottom: 6px;
    }
}

#spectators-container {
    padding-bottom: 2px;
    @media (max-width: 575.98px) {
        padding-bottom: 4px;
    }
}

body.bbg-side-rails-active {
  @media (min-width: 1280px) {
    @cell-dim-rails: 88px;

    #board {
      grid-template-columns: repeat(3, @cell-dim-rails) !important;
      grid-template-rows: repeat(3, @cell-dim-rails) !important;
    }

    .piece {
      height: @piece-size-ratio * @cell-dim-rails !important;
      width: @piece-size-ratio * @cell-dim-rails !important;
    }
  }
}
