﻿/* --- Universal Box Sizing with Inheritance --- */
@import url("https://fonts.googleapis.com/css2?family=Bungee+Inline&display=swap");
html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

:root {
  --cell-size: 90px;
  --grid-gap: 12px;
  --h1-font-size: 32px;
  --h1-span-font-size: 24px;
  --current-status-font-size: 24px;
  --current-beast-img-height: 32px;
  --winning-beast-img-width: 200px;
  --winning-msg-font-size: 60px;
  --reset-btn-font-size: 60px;
}

@media (min-width: 600px) {
  :root {
    --cell-size: 250px;
    --grid-gap: 15px;
    --h1-font-size: 120px;
    --h1-span-font-size: 40px;
    --current-status-font-size: 60px;
    --current-beast-img-height: 100px;
  }
}
@media (min-width: 1024px) {
  :root {
    --h1-font-size: 64px;
    --h1-span-font-size: 48px;
    --winning-msg-font-size: 72px;
    --reset-btn-font-size: 48px;
    --winning-beast-img-width: 150px;
  }
}
/* --- Styles --- */
body {
  margin: 0;
  padding: 0;
  background-image: url("bg.jpg");
  background-size: cover;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: "Bungee Inline", cursive;
  color: #f5f5f5;
}

#brand_logo
 {
  position: relative;
  width: 30%;
  height: auto;
  opacity: 0.8;
  margin-bottom: 10px;
}


h1 {
  position: relative;
  max-width: 100%;
  margin: 15px auto 15%;
  text-align: center;
  font-size: var(--h1-font-size);
  line-height: 90px;
  text-shadow: 3px 3px #55acee;
}
h1::before, h1::after {
  content: "";
  display: block;
  position: absolute;
  background-repeat: no-repeat;
  background-size: 100%;
  top: 50%;
  transform: translateY(-50%);
}
h1::before {
  left: 0;
  width: calc( 93px / 2.1 );
  height: calc( 96px / 2.1 );
}
@media (min-width: 1024px) {
  h1::before {
    left: -64px;
  }
}
h1::after {
  right: 0;
  width: calc( 91px / 2 );
  height: calc( 88px / 2 );
}
@media (min-width: 1024px) {
  h1::after {
    right: -64px;
  }
}
h1 span {
  display: block;
  font-size: var(--h1-span-font-size);
}
@media (min-width: 1024px) {
  h1 span {
    display: inline;
  }
}

h1,
p {
  letter-spacing: 1px;
}

.current-status {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
}
@media (min-width: 1024px) {
  .current-status {
    margin-bottom: 35px;
  }
}
.current-status p {
  margin: 0 5px 0 0;
  font-size: var(--current-status-font-size);
}
.current-status img {
  width: auto;
  height: var(--current-beast-img-height);
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  grid-template-rows: repeat(3, minmax(150px, 1fr));
  grid-gap: var(--grid-gap);
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0 auto 15px;
}
.board.unicorn .cell:not(.dragon):not(.unicorn):hover::before, .board.dragon .cell:not(.dragon):not(.unicorn):hover::before {
  content: "";
  width: 90%;
  height: 90%;
  display: block;
  position: absolute;
  background-repeat: no-repeat;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  background-size: contain;
  opacity: 50%;
}
.board.unicorn .cell:not(.dragon):hover::before {
  background-image: url("01.png");
}
.board.dragon .cell:not(.unicorn):hover::before {
  background-image: url("02.png");
}

.cell {
  cursor: pointer;
  position: relative;
  background-color: #f5f5f5;
  width: var(--cell-size);
  height: var(--cell-size);
  opacity: 0.5;
  transition: opacity 0.2s ease-in-out;
}
.cell:hover {
  opacity: 1;
}
.cell.dragon, .cell.unicorn {
  opacity: 1;
  position: relative;
  cursor: not-allowed;
}
.cell.dragon::before, .cell.unicorn::before {
  content: "";
  width: 90%;
  height: 90%;
  display: block;
  position: absolute;
  background-repeat: no-repeat;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  background-size: contain;
}
.cell.dragon::before {
  background-image: url("02.png");
}
.cell.unicorn::before {
  background-image: url("01.png");
}

.game-end-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #0d1021;
}
.game-end-overlay.show {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.winning-message {
  margin: -50px 0 20px;
}
.winning-message img {
  width: var(--winning-beast-img-width);
}
.winning-message p {
  font-size: var(--winning-msg-font-size);
  margin: 0;
}

.btn-container {
  position: relative;
}

.reset-button {
  color: #f5f5f5;
  font-family: "Bungee Inline", cursive;
  font-size: var(--reset-btn-font-size);
  white-space: nowrap;
  border: none;
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #a186be;
  box-shadow: 5px 5px 0 #55acee;
  cursor: pointer;
  transition: transform 0.1s ease-in-out;
  position: relative;
}
.reset-button:hover {
  transform: scale(1.2);
}
.reset-button:active {
  top: 6px;
  left: 6px;
  box-shadow: none;
  background-color: #9475b5;
}