/*
 * Copyright (c) 2025-2026 Evolution Creek Software. All rights reserved.
 *
 * Unauthorized copying, linking, or other unintended use of this file
 * (in part or in whole) is strictly prohibited.
 */

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100vw;
  margin: 0 auto;
  background-color: beige;
  opacity: 0;
  animation: fadeIn 0.2s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main{
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: stretch;
  background-color: beige;
  margin-top: 0rem;
  height: 100vh;
}

img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

header {
  display: flex;
  background-color: wheat;
  box-shadow: 0 0 10px 3px peru;
  justify-content: center;
  align-items: center;
  padding: 1rem 2rem;
  position: relative;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  transition: opactiy 0.2s ease;
}

h1 {
  justify-self: center;
  font-family: 'Salsa', cursive;
  font-weight: 400;
  font-size: 2.5rem;
  margin: 0;
  cursor: default;
  transition: opactiy 0.2s ease;
  line-height: 1;
  text-align: center;
  max-width: 70vw;
}

#headerIcon {
  position: absolute;
  left: 0rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 600ms, left 0.3s ease;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  z-index: 1100;
}

.line {
  fill: none;
  transition: stroke-dasharray 600ms, stroke-dashoffset 600ms, stroke 800ms;
  stroke: #000;
  stroke-width: 5.5;
  stroke-linecap: butt;
}

.ham8 .top {
  stroke-dasharray: 40 160;
}

.ham8 .middle {
  stroke-dasharray: 40 142;
  transform-origin: 50%;
  transition: transform 600ms;
}

.ham8 .bottom {
  stroke-dasharray: 40 85;
  transform-origin: 50%;
  transition: transform 600ms, stroke-dashoffset 600ms;
}

.ham8.active .top {
  stroke-dashoffset: -64px;
}

.ham8.active .middle {
  transform: rotate(90deg);
}

.ham8.active .bottom {
  stroke-dashoffset: -64px;
}

#headerIcon.active {
  transform: rotate(45deg);
  position: fixed;
}

#headerIcon.active .line {
  stroke: saddlebrown;
}


#sideMenu {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background: white;
  box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  padding: 2rem 1rem;
  transition: left 0.3s ease;
  z-index: 1000;
  background-color: beige;
  display: flex;
  flex-direction: column;
}

#sideMenu.active {
  left: 0;
}

#sideMenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: 3rem;
}

#sideMenu li {
  margin: 1rem 0;
}

#sideMenu a {
  text-decoration: none;
  font-family: 'Patrick Hand', cursive;
  font-size: 1.7rem;
  color: black;
  transition: color 0.2s ease;
}

#sideMenu a:hover {
  color: saddlebrown;
}

#socialIcons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  margin-top: auto;
  margin-bottom: -1rem;
}

#socialIcons i {
  font-size: 1.7rem;
  color: black;
  transition: color 0.2s ease;
}

#socialIcons a {
  position: relative;
}

#socialIcons a::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: sienna;
  color: white;
  font-family: 'Salsa', cursive;
  font-size: 1rem;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#socialIcons a:hover::after {
  opacity: 1;
}

#socialIcons a:hover i {
  color: sienna;
}

.grid {
  display: grid;
  justify-content: center;
  width: 100%;
  flex: 1;
  overflow-x: hidden;
  border-left: 4px solid saddlebrown;
  border-bottom: 2px solid saddlebrown;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  height: 100vh;
}

.title {
  background-color: wheat;
  color: saddlebrown;
  position: absolute;
  font-family: 'Yeon Sung', system-ui;
  padding: 0.5em 0.5em;
  font-size: 1.5rem;
  text-align: center;
  width: 11rem;
  display: flex;                  /* add these */
  align-items: center;            /* vertically center */
  justify-content: center;
  box-shadow: 0 0 8px 4px rgba(139, 90, 43, 1);
  transition: color 0.2s ease, width 0.5s ease, aspect-ratio 0.5s ease, border-radius 0.5s ease, background-color 0.5s ease;
  z-index: 2;
}

.square {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  text-decoration: none; 
  color: inherit; 
  position: relative;
  box-sizing: border-box;
  aspect-ratio: 5/3;
  overflow: hidden;
  font-size: clamp(20px, 2rem, 40px);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  background-color: beige;
  border-right: 4px solid saddlebrown;
  border-top: 2px solid saddlebrown;
}

.square img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes rotate {
  to {
    --angle: 360deg;
  }
}

.square-description {
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  text-align: center;
  padding: 0.5rem;
  color: black;
  font-family: "Caveat Brush", cursive;
  font-weight: 400;
  font-style: normal;
  font-size: 1.5rem;
  pointer-events: none;
  display: none;
}

.title.active{
  background: saddlebrown;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#extraInfoDiv {
  width: 100%;
  background-color: wheat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

#signInCard {
  text-align: center;
  width: 100%;
  margin-bottom: 1rem;
}

#signInCard p {
  width: 60vw;
  font-size: 1.3rem;
  font-family: "Afacad Flux", sans-serif;
  font-weight: 500;
  margin: 0 auto; 
}

#signInCardBtn {
  font-family: 'Salsa', cursive;
  font-size: 1.4rem;
  padding: 0.4em 1.2em;
  background-color: rgb(255, 238, 192);
  border: 2px solid black;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 1rem;
}

#signInCardBtn:hover {
  background-color: peru;
}

#symbolLine {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  width: 100%;
  padding: 1rem 0;
  overflow: hidden;
}

#symbolLine img {
  position: static;
  width: 2.5rem;
  height: auto;
  object-fit: contain;
}

#leaderboardSection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(500px, 90vw);
}

#leaderboardTitle {
  font-family: 'Salsa', cursive;
  font-size: 1.8rem;
  font-weight: 400;
  color: saddlebrown;
  text-align: center;
}

#leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-family: "Afacad Flux", sans-serif;
  font-weight: 500;
  font-size: 1.4rem;
}

#leaderboard th,
#leaderboard td {
  padding: 0.4rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(139, 90, 43, 0.3);
}

#leaderboard thead tr {
  background-color: saddlebrown;
  color: wheat;
}

#leaderboard .col-rank { width: 2.5rem; text-align: center; }
#leaderboard .col-pts  { text-align: right; }

#fullLeaderboardLink {
  font-family: "Afacad Flux", sans-serif;
  font-weight: 500;
  font-size: 1.3rem;
  color: saddlebrown;
  text-decoration: none;
  align-self: flex-end;
  transition: color 0.2s ease;
}

#fullLeaderboardLink:hover {
  color: black;
}

@media (hover: hover) and (pointer: fine){
  .square:hover .square-description {
    opacity: 1;
  }

  .square:hover img {
    opacity: 0.2;
  }

  .square:hover .title{
    background-color: transparent;
  }

  .square:hover {
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: inset 0 0 60px 20px rgba(139, 90, 43, 0.7);
    z-index: 50;
  }

  .square::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.4s ease;
    background-image: conic-gradient(
      from var(--angle),
      saddlebrown 0deg 90deg,
      wheat 90deg 180deg,
      saddlebrown 180deg 270deg,
      wheat 270deg 360deg
    );
    animation: rotate 6s linear infinite;
    -webkit-mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    mask-composite: exclude;
    padding: 3px; /* controls border thickness */
  }

.square:hover::before {
  opacity: 1;
}

  .square-description:hover{
    opacity:1;
  }

  .square:hover .title {
    width: 100%;
  }

}

@media (hover: none) and (pointer: coarse) {
  .square:hover{
    transform: scale(1.05);
  }
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
  color: #666;
  cursor: default;
  margin-top: auto;
}

@media (orientation: portrait) {
  main {
    display: grid;
    height: 100vh;
    align-content: stretch;
  }

  .grid{
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    border-bottom: 4px solid saddlebrown;
  }

  .square {
    height: 100%;
    aspect-ratio: unset;
    border-top: 4px solid saddlebrown;
  }

  .title{
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 20px;
    line-height: 1.2;
  }

  .square-description {
    font-size: 1rem;
  }

  footer{
    border-top: 4px solid saddlebrown;
  }
}



@media (max-width: 700px) {
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  h1{
    font-size: 1.5rem;
    line-height: 1;
    max-width: 60vw;
    text-align: center;
    margin-top: 0.5rem;
  }

  #headerIcon{
    left: 0rem;
    padding: 7px;
  }

  #sideMenu.active + #headerIcon,
  #headerIcon.active {
    left: 0rem;
    position: fixed;
  }


  #sideMenu {
    left: -100vw;
    width: 100vw;
    box-sizing: border-box;
  }

  #sideMenu.active {
    left: 0;  /* Add !important here too */
  }

  #sideMenu ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  #sideMenu a {
  	font-size: 1.5rem;
  }

  #socialIcons {
    margin-top: 0rem;
  }

  #socialIcons i {
    font-size: 1.7rem;
  }

  #socialIcons a::after {
    bottom: -130%;
  }


  .title{
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 1rem;
    width: 8rem;
    line-height: 1.2;
    padding: 0.5em 0em;
  }

  .square-description {
    font-size: 1rem;
  }

  main {
    display: grid;
    height: 100vh;
    align-content: stretch;
  }

  .grid{
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    border-bottom: 4px solid saddlebrown;
  }

  .square {
    height: 100%;
    aspect-ratio: unset;
    border-top: 4px solid saddlebrown;
  }

  #signInCard p {
    font-size: 1rem;
    width: 80vw;
  }

  #symbolLine {
    gap: 2rem;
  }

  #symbolLine img {
    width: 2rem;
  }

  footer{
    margin-top: auto;
    border-top: 4px solid saddlebrown;
  }

  
}
