@use './mixins/display' as *;
@use './mixins/effects' as *;
@import './mixins/variables';

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  padding: 0;
  margin: 0;
}

.App {
  text-align: center;
}

.App-logo {
  height: 40vmin;
  pointer-events: none;
}

.App-header {
  background-color: $theme;
  min-height: 100vh;
  @include flex-col;
  align-items: center;
  justify-content: center;
  font-size: calc(10px + 2vmin);
  color: white;
}

.App-link {
  color: #61dafb;
}

@keyframes App-logo-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

#game-frame {
  // border: 1px solid orange;
  // position: relative;
  $height: 945px;
  $width: $height;
  height: $height;
  width: $width;
  max-height: 100vw;
  max-width: 100vw;
  display: grid;
  align-items: center;
  justify-items: center;
  grid-template-rows: .75fr repeat(12, 1fr) .75fr;
  grid-template-columns: .75fr repeat(12, 1fr) .75fr;
  // grid-gap: 1px solid blue;

  >.label {
    grid-column: var(--x);
    grid-row: var(--y);
  }

  >.border-tile {
    box-sizing: border-box;
    border: 1px solid blue;
    height: 100%;
    width: 100%;
    grid-column: var(--x);
    grid-row: var(--y);

    &.edge {
      border: 1px solid gray;
    }

    @include gradient-edge;
  }

  > :not(.border) {
    box-sizing: border-box;
    // border: 1px solid red;
  }

  >span {
    vertical-align: center;
    user-select: none;
  }

  .ship {
    height: 100%;
    width: 100%;
    position: relative;
    @include flex-col;
    align-items: center;
    // justify-content: center;
    border: 1px solid yellow;
    grid-row: var(--x);
    pointer-events: none;

    img {
      position: absolute;
      // height: 90%;
      width: 90%;
      // object-fit: cover;
    }

    &.s1 {
      grid-column: 3 / 7;
    }

    &.s2 {
      grid-column: 3 / 5;
    }

    &.s3 {
      grid-column: 3 / 6;

      img {
        margin-top: -2%;
      }
    }

    &.s4 {
      grid-column: 3 / 6;
    }

    &.s5 {
      grid-column: 3 / 6;
    }

    &.s6 {
      grid-column: 3 / 7;
    }
  }

  .hit-svg {
    // border: 2px solid blue;

    // height: 50px;
    // width: 50px;
    height: 100%;
    width: 100%;
    position: relative;
    @include flex;
    // align-items: center;
    // align-self: center;
    // justify-self: center;
    grid-column: var(--x);
    grid-row: var(--y);
    pointer-events: none;

    svg {
      position: absolute;
      height: 100%;
      width: 100%;

      box-sizing: border-box;
      padding: 25%;

      &.fa-burst {
        color: red;
      }
    }

    &.target {
      color: red;
      opacity: 0;
    }

    &.target-preview {
      color: orange;
      opacity: 0;
      @include transition(.2s);

    }

    &.show {
      opacity: 1;
    }
  }

  .r2 {
    border: 2px solid green;
  }

  .r3 {
    border: 2px solid yellowgreen;
  }

  .fog {
    width: inherit;
    pointer-events: none;

    &.left {
      grid-area: 1 / 1 / -1 / -1;
      align-self: flex-start;
      transform: rotate(180deg);
    }

    &.right {
      grid-area: 1 / 1 / -1 / -1;
      align-self: flex-end;
    }

    &.middle {
      grid-area: 4 / 4 / -4 / -4;
    }
  }
}