@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  position:relative;
}
body{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #f0f0f0;
}
.container{
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  padding: 10px;
  max-width: 1050px;
}

section{
  background: #fff;
  border-radius: 7px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.tools-board {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 240px;
  padding: 20px;
}

.tool-group {
  width: 100%;
}

.banner {
  width: auto;
  justify-content: center;
  display: flex;
}

.tool-group .title {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #5A6168;
  margin-bottom: 8px;
}

.name-input, #pokeselect {
  width: 100%;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

#pokeselect {
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
}

.name-input:focus, #pokeselect:focus {
  border-color: #4A98F7;
}

.timer-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.timer-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.row .options, .options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.options .option{
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.tool-options .option {
  width: 35px;
  height: 35px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.tool-options .option:hover {
    background-color: #f0f0f0;
}

.tool-options .option.active {
    border-color: #4A98F7;
    background-color: #e9f2fe;
}

.option img {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.option.active img {
    opacity: 1;
    filter: invert(48%) sepia(85%) saturate(1588%) hue-rotate(195deg) brightness(100%) contrast(97%);
}

#size-slider{
  width: 100%;
  height: 5px;
  accent-color: #4A98F7;
}

.color-options {
  flex-wrap: wrap;
}

.color-options .option{
  height: 25px;
  width: 25px;
  border-radius: 50%;
  position: relative;
}

.color-options .option.selected::before{
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  height: 14px;
  width: 14px;
  background: inherit;
  border-radius: inherit;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.color-picker-wrapper {
    border: 1px dashed #ccc;
    padding: 2px;
}

#color-picker{
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.buttons{
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 5px;
}

.buttons button{
  width: 100%;
  color: #fff;
  border: none;
  outline: none;
  padding: 11px 0;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.buttons .clear-canvas{
  color: #6C757D;
  background-color: #fff;
  border: 1px solid #ccc;
}
.clear-canvas:hover{
  background-color: #f7f7f7;
  border-color: #6C757D;
}
.clear-canvas:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

.drawing-board{
  flex: 1;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: max-content;
}

.drawing-board canvas{
  border: 1px solid #adcef7;
  width: 100%;
  height: 100%;
}

.canvas-container {
  width: 500px;
  height: 100%;
  aspect-ratio: 1 / 1;
}

#results-link {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  display: flex;
  padding: 40px;
  text-align: center;
  flex-direction: column;
}
#results-link label{
  font-size: 2rem;
  color: #fff;
}

#status {
  color:#fff
}
@keyframes rainbow {
    0%,100% {color: rgb(255, 0, 0);} 16.66% {color: rgb(255, 255, 0);} 33.33% {color: rgb(0, 255, 0);} 50.00% {color: rgb(0, 255, 255);} 66.67% {color: rgb(61, 61, 255);} 83.33% {color: rgb(255, 0, 255);}
}
#results-link a{
  font-weight: bolder;
  animation: 5s infinite linear forwards rainbow;
  text-decoration: none;
}

#greyout {
  position:fixed;
  height:100vh;
  width:100vw;
  top:0;
  left:0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 10;
}

/*desktop*/
@media (min-width: 768px) {
  .container {
    flex-direction: row;
    align-items: flex-start;
  }
}

/*mobile*/
@media (max-width: 767px) {
  body {
    min-height: 100dvh;
  }
  .container {
    flex-direction: column;
    align-items: center;
  }
  .tools-board {
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: center;
  }
  .buttons {
      grid-column: 1 / -1;
      margin-top: 0;
      border-top: none;
      padding-top: 0;
  }
  .drawing-board {
    width: 100%;
  }
  .canvas-container {
    width: 95vw;
    max-height: 95vw;
  }
  .banner {
    display: none;
  }
}
