html,
body {
  height: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: 0.5s ease;
  user-select: none;
}

:root {
  --text: #c21b;
  --img: url('spring-flower.jpg');
  --calbg: radial-gradient(#fcdb, #fbca);
  --onbg: #fff5;
  --surface: #fffd;
  --size: 0.2rem;

  @media (prefers-color-scheme: dark) {
    --text: #ef2c;
    --img: url('evening-light.jpg');
    --calbg: linear-gradient(to bottom right, #2204, #1204);
    --onbg: #2227;
    --surface: #000d;
  }
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: var(--img);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  padding: 2dvmin;
}

main {
  height: 96dvmin;
  width: 96dvmin;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
}


#calendar {
  width: 100%;
  height: 100%;
  background: var(--calbg);
  backdrop-filter: blur(3px);
  z-index: 1;
}

#day {
  position: absolute;
  z-index: 2;
  top: 0;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(3px);

  h2 {
    color: var(--text);
    margin: 1rem 0;
    font-style: italic;
  }

  textarea {
    height: calc(90dvmin - 1rem);
    aspect-ratio: 1;
    margin: calc(3dvmin + 0.5rem);
    border: none;
    resize: none;
    background: none;
    outline: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;

    &::placeholder {
      color: var(--text);
      opacity: 67%;
    }
  }
}

.hide {
  display: none !important;
}

header {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  padding: 0.5rem;

  button {
    border: none;
    background: none;
    font-weight: bolder;
    font-size: large;
    color: var(--text);

    &:first-child,
    &:last-child {
      border: solid var(--text);
      border-width: 0 var(--size) var(--size) 0;
      display: inline-block;
      padding: var(--size);
    }

    &:first-child {
      transform: rotate(135deg);
    }

    &:last-child {
      transform: rotate(-45deg);
    }

    &:active {
      transform: scale(1.1);
    }
  }
}

table {
  width: 100%;
  margin-top: var(--size);
  height: calc(100% - 3rem);
  color: var(--text);

  th {
    background: var(--onbg);
    border-radius: 0.5rem;
    padding: var(--size) 0;
  }

  td {
    font-weight: bold;
    position: relative;

    &.inactive {
      opacity: 0.5;
      font-weight: normal;
    }

    &.active {
      background: var(--onbg);
      border-radius: 1rem;
      border-bottom-right-radius: 0.5rem;
      border: dotted 1px var(--text);
    }

    &.logged::after {
      content: '∅';
      position: absolute;
      top: 0.1rem;
    }
  }

  th,
  td {
    width: calc(100% / 7);
    text-align: center;
  }
}