header {
  position: fixed;
  top: 0;
  left: 0;
  height: 30px;
  width: 100%;
  display: flex;
  align-items: center;
  background-color: #fff;
  padding: 20px 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 300;
}

.logo {
  top: 10px;         
  left: 0px;          
  width: 60px;
  height: auto;
}

a {
  text-decoration: none;
  color: black;
}

span.teamname {
  position: relative;
  top: -5px;
}

.sns-icon {
  width: 32px;
  height: 32px;
}

/* スマホ用（874px以下） */
@media (max-width: 874px) {
  .logo {
    text-align: left; 
    width: 40px;
    top: 5px;          
    left: 0;
  }

  body {
    padding-top: 100px;
  }

  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 20px 0px 20px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .menu-icon {
    display: block;
    z-index: 1101;
    text-align: right;
    font-size: 32px;
    top: 0px;
    margin-top: -5px;
    margin-left: 60vw;
  }

  .menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: -50px;
    right: -100%;
    width: 200px;
    height: 100%;
    background-color:#1a1a1a;
    padding: 60px 20px;
    transition: right 0.3s ease;
    z-index: 1100;
    overflow-y: auto;
    margin: 0;
  }

  .menu li {
    margin: 4% 0;
    text-align: left;
    font-size: large;
    padding: 4px;
  }

  .menu li a {
    font-family: 'Anton SC';
    font-weight: 700;
    letter-spacing: 2px;
    font-weight: 300;
    font-size: 25px;
    display: block;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }



  .menu.active {
    right: 0;
  }

  #menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }

  .menu.active ~ #menu-overlay {
    display: block;
  }
}

/* タブレット用（875px-1023px） - 重要：max-widthを追加 */
@media (min-width: 875px) and (max-width: 1023px) {
  .logo {
    width: 50px;
  }

  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 20px 0px 20px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  header a span {
    position: relative;
    top: -7px;
    left: -10px;
  }

  .menu-icon {
    display: block;
    z-index: 1101;
    text-align: right;
    font-size: 32px;
    top: 0px;
    margin-top: -5px;
    margin-left: 80vw;
  }

  .menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: -50px;
    right: -100%;
    width: 250px;
    height: 100%;
    background-color: #1a1a1a;
    padding: 60px 20px;
    transition: right 0.3s ease;
    z-index: 1100;
    overflow-y: auto;
    margin: 0;
  }

  .menu li {
    margin: 4% 0;
    text-align: left;
    font-size: large;
    padding: 4px;
  }

  .menu li a {
    display: block;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .menu.active {
    right: 0;
  }

  .menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  #menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }

  .menu.active ~ #menu-overlay {
    display: block;
  }
}

/* パソコン用（1024px以上） */
@media (min-width: 1024px) {
  .logo {
    width: 60px;
    height: auto;
  }

  header {
    position: fixed;
    top: 0;
    left: 0;
    height: 30px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 20px 400px 20px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 300;
  }

  header a span {
    position: relative;
    top: -7px;
    left: -10px;
  }

  .menu-icon {
    display: none !important;
  }

  .menu {
    list-style: none;
    display: flex !important;
    flex-direction: row;
    position: static;
    top: auto;
    right: auto;
    width: auto;
    height: auto;
    background-color: transparent;
    padding: 0;
    margin: 0;
    margin-right: 50px;
    transition: none;
    z-index: auto;
    overflow-y: visible;
    opacity: 1;
    transform: none;
  }

  .menu li {
    margin: 0 10px;
    text-align: center;
    font-size: 15px;
    padding: 0;
  }

  .menu li a {
    display: block;
    text-decoration: none;
    color: #333 !important;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
  }

  .menu li a:hover {
    background-color: #f5f5f5;
    color: #0f0101 !important;
  }

  #menu-overlay {
    display: none !important;
  }

  .menu.active {
    display: flex !important;
    flex-direction: row;
    position: static;
    background-color: transparent;
    right: auto;
    width: auto;
    height: auto;
  }
}