/* ============================================
General page layout
*/

body {
  background-color: rgb(0, 0, 0);
  position: relative;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

/* pattern background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(
      90deg,
      transparent 1px,
      rgba(0, 0, 0, 0.1) 1px,
      rgba(0, 0, 0, 0.1) 2px,
      transparent 2px
    ),
    linear-gradient(0deg, #90292334 0%, #2a0b0aae 50%, #000000d7 100%),
    linear-gradient(
      45deg,
      #424b54 25%,
      transparent 25%,
      transparent 75%,
      #424b54 75%
    );
  background-size: 20px 100%, 100% 100%, 40px 40px;
  background-color: #902923;
}

#pageLayout {
  display: grid;
  grid-template-rows: max-content 1fr 75px;
  grid-template-columns: 1fr;
  align-items: center;
  height: 100vh;
}

#pageBanner {
  background-color: #a22c29;
  padding: 0px;
}

#pageBanner h1 {
  margin: 0;
  padding-bottom: 5px;
  align-self: center;
  text-align: center;
  font-family: 'Medula One', cursive;
  font-size: calc(1em + 4vw);
  color: #fcfcfc;
}

/* ============================================
Game area grid, made of 3 parts; enemy 'cards', fighting area and ally 'cards'
*/
.gameArea {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: calc(100vh - 180px);
}
.gameArea__text {
  font-family: 'Lato', sans-serif;
  border-top: ridge 4px;
  font-size: small;
  font-weight: 900;
  margin: 0;
  padding: 2% 0 0 0;
  background-color: whitesmoke;
}

.gameArea--damageAnimation {
  animation: damagePulse 0.2s infinite;
}

@keyframes damagePulse {
  0% {
    background-color: whitesmoke;
  }
  50% {
    background-color: maroon;
  }
  100% {
    background-color: whitesmoke;
  }
}

.gameArea--healingAnimation {
  animation: healingPulse 0.2s infinite;
}
@keyframes healingPulse {
  0% {
    background-color: whitesmoke;
  }
  50% {
    background-color: steelblue;
  }
  100% {
    background-color: whitesmoke;
  }
}
/*==============================
Dragon card styling
*/
.gameArea__Dragon {
  text-align: center;
  padding: 0;
  justify-self: center;
  width: calc(300px + 8vw);
  background-color: #fcfcfc;
  border-radius: 5px;
  box-shadow: 2px 5px 15px 8px rgb(39, 39, 39);
}
.gameArea__Dragon pre {
  display: inline-block;
  text-align: left;
  font-size: 10px;
  margin: 0;
}

/* =====================================
Fighting area styling
*/
.gameArea__fighting {
  display: grid;
  max-height: 100%;
  grid-template-rows: 30px 1fr 30px;
  margin: 30px 0;
  align-items: center;
  z-index: 3;
}

.gameArea__fighting__actionCard {
  text-align: center;
  padding: 0;
  justify-self: center;
  height: 0px;
  width: 0px;
  background-color: #fcfcfc;
  border-radius: 5px;
  box-shadow: 2px 5px 15px 8px rgb(39, 39, 39);
  opacity: 0;
  transition: opacity 0.2s;
  overflow: hidden;
}
.gameArea__fighting__actionCard pre {
  display: none;
  text-align: left;
  font-size: 5px;
  font-family: monospace;
  font-weight: bolder;
  margin: 0;
}

.gameArea__fighting__players {
  display: flex;
  height: 100%;
  justify-content: space-evenly;
  align-items: center;
  max-height: 100px;
}

/*
add transition class
*/
.gameArea__fighting__actionCard--transition {
  height: 75px;
  width: 75px;
  opacity: 1;
}
.gameArea__fighting__actionCard--transition pre {
  display: inline-block;
}

.gameArea__fighting__actionCard--animation {
  animation: jingle 0.4s infinite;
}
/* safari and chrome */
@-webkit-keyframes jingle {
  0% {
    -webkit-transform: rotate(4deg);
  }
  50% {
    -webkit-transform: rotate(-4deg);
  }
  100% {
    -webkit-transform: rotate(4deg);
  }
}

/* firefox */
@-moz-keyframes jingle {
  0% {
    -moz-transform: rotate(4deg);
  }
  50% {
    -moz-transform: rotate(-4deg);
  }
  100% {
    -moz-transform: rotate(4deg);
  }
}

@keyframes jingle {
  0% {
    transform: rotate(4deg);
  }
  50% {
    transform: rotate(-4deg);
  }
  100% {
    transform: rotate(4deg);
  }
}

/*========================================
ticker tape box
*/
#fightTickerTape {
  position: fixed;
  right: 10px;
  top: 15%;
  width: 320px;
  max-width: 35%;
  height: 244px;
  background-color: #f8f8f8;
  backdrop-filter: blur(5px);
  box-shadow: 2px 5px 15px 8px rgba(39, 39, 39, 0.3);
  border-radius: 8px;
  border: 2px solid #ddd;
  overflow: hidden;
}

#fightTickerTape::before {
  content: '⚔️ Battle Log';
  display: block;
  background: linear-gradient(145deg, #e0e0e0, #f8f8f8);
  border-bottom: 2px solid #ccc;
  padding: 6px 10px;
  font-family: 'Medula One', cursive;
  font-size: 22px;
  font-weight: bold;
  color: #555;
  text-align: center;
}

.tickerText {
  text-align: left;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  padding: 8px 10px;
  color: #333;
  height: calc(100% - 66px);
  overflow-y: auto;
  line-height: 1.4;

  scrollbar-width: thin;
  scrollbar-color: #999 #f1f1f1;
}

.tickerText::-webkit-scrollbar {
  width: 6px;
}

.tickerText::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.tickerText::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 3px;
}

.tickerText::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* Ticker text formatting */
.ticker-time {
  color: #666;
  font-size: 9px;
  font-weight: 400;
}

.tickerText br + br {
  line-height: 0.8;
}

/* ============================================
Player card styling
*/
.gameArea__players {
  display: flex;
  justify-content: space-evenly;
}

.gameArea__players__playerCard {
  text-align: center;
  padding: 0;
  justify-self: center;
  width: calc(100px + 6vw);
  background-color: #fcfcfc;
  border-radius: 5px;
  box-shadow: 2px 5px 15px 8px rgb(39, 39, 39);
}
.gameArea__players__playerCard pre {
  display: inline-block;
  text-align: left;
  font-size: 8px;
  margin: 0;
}

.gameArea__text {
  transition: all 0.7s ease;
}

/* =====================================================
Control panel buttons at bottom of page
*/
.controlPanel {
  height: 3.4em;
  width: 100%;
  position: absolute;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
  gap: 16px;
}

.controlPanel__button {
  height: 100%;
  width: 120px;
  align-items: center;
  font-family: 'Lato', sans-serif;
  word-wrap: normal;
  font-size: calc(8px + 0.3vw);
  border-radius: 2px;
  box-shadow: 1px 1px 2px 2px #01161e;
  background: linear-gradient(#01161e, #596475);
  border: 1px solid #01161e;
  color: #fcfcfc;
  cursor: pointer;
}

.controlPanel__button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.controlPanel__button:active:enabled {
  transition: all 150ms linear;
  color: black;
}

/* =================================================
Game end notification box
*/
.endingOverlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 500ms;
  visibility: hidden;
  opacity: 0;
  z-index: 10;
}
.endingOverlay:target {
  visibility: visible;
  opacity: 1;
}

.endingOverlay__popupWindow {
  margin: 120px auto;
  padding: 20px;
  background: whitesmoke;
  border-radius: 5px;
  width: 50%;
  position: relative;
  transition: all 5s ease-in-out;
  box-shadow: 2px 5px 15px 8px rgb(39, 39, 39);
}

.endingOverlay__popupWindow__heading {
  margin-top: 0;
  text-align: center;
  color: #333;
  font-family: 'Medula One', cursive;
  font-size: calc(10px + 5vw);
}

.endingOverlay__popupWindow__content {
  max-height: 30%;
  color: #333;
  font-family: 'Lato', sans-serif;
  overflow: auto;
  font-size: calc(10px + 1vw);
}

.endingOverlay__popupWindow__button {
  position: absolute;
  top: 0px;
  right: 15px;
  transition: all 200ms;
  font-size: 40px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}

/* =================================================
Mobile view adjustments
*/
@media (max-width: 768px) {
  #fightTickerTape {
    position: relative;
    width: 95%;
    max-width: none;
    margin: 15px auto;
    right: auto;
    top: auto;
    height: 150px;
  }

  #fightTickerTape::before {
    font-size: 16px;
    padding: 4px 8px;
  }

  .tickerText {
    font-size: 12px;
    padding: 6px 8px;
    height: calc(100% - 44px);
  }

  .gameArea__Dragon {
    width: 90%;
    max-width: 350px;
  }

  .gameArea__Dragon pre {
    font-size: 8px;
  }

  .gameArea__players__playerCard {
    width: calc(80px + 4vw);
  }

  .gameArea__players__playerCard pre {
    font-size: 6px;
  }

  .controlPanel__button {
    width: 100px;
    font-size: 10px;
  }
}
