.list_items {
  font-family: 'Acme';

  .list_item_wrap {
    position: relative;
    outline: 0;
  }

  .game_line_item_link {
    position: absolute;
    inset: 0;
    z-index: 1;

    &:hover + .game_line_item {
      background: whitesmoke;
    }

    &:active + .game_line_item {
      background: white;
    }

    &:focus-visible {
      outline: 2px solid var(--btn-primary);
      outline-offset: -2px;
    }
  }

  .buttons {
    position: absolute;
    bottom: 10px;
    right: 10px;
    overflow: hidden;
    z-index: 2;

    &.nudge {
      bottom: 6px;

      .btn_link {
        font-size: 14px;
        padding: 4px 7px;
      }

      a.btn_link {
        background-color: #ffca28;
      }
    }

    .building {
      padding: 5px 12px;
      border: 1px solid #000;
      background-color: dodgerblue ;
      border-radius: 3px;
      color: #fff;
    }

    .action_btn {
      display: inline-block;
      color: black;
      padding: 7px 12px;
      margin-left: 5px;
      border: 1px solid black;
      border-radius: 3px;
      background: url("/assets/bar-c5b99f4b.png") center repeat-x;

      &:hover {
        box-shadow: inset 1px 1px 2px rgba(0,0,0,0.3);
      }

      &:active {
        box-shadow: inset 1px 1px 2px rgba(0,0,0,0.6);
      }
    }

    .accept {
      background-color: yellowgreen;
    }

    .reject {
      background-color: crimson;
    }
  }
}

.line_item {
  color: #333;
  position: relative;
  overflow: hidden;
  height: 70px;
  border-bottom: 1px solid silver;

  &:hover {
    background: whitesmoke;
  }

  &:active {
    background: white;
  }

  .title_text {
    display: block;
  }

  &.hilight {
    background: aliceblue;

    &:active {
      background: white;
    }
  }

  .avatar {
    float: left;
    margin-right: 10px;
  }

  .message_waiting {
    position: absolute;
    left: 60px;
    top: 10px;
    font-size: 2em;
    z-index: 1;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }

  .score {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    margin-top: 1px;
    color: #7b8793;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;

    .username {
      box-sizing: border-box;
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-width: 0;
      max-width: 190px;
      padding: 3px 6px 3px 5px;
      border: 1px solid transparent;
      border-left-width: 3px;
      border-radius: 6px;
      background-image: none;
      color: #263746;
      font-size: 15px;
      box-shadow: 0 1px 2px rgba(25, 48, 68, 0.08);

      &.player_1 {
        border-color: #9ddcf8;
        border-left-color: var(--player-1);
        background: #e8f7fd;
      }

      &.player_2 {
        border-color: #f0b4ae;
        border-left-color: var(--player-2);
        background: #fcecea;
      }

      .player_name {
        overflow: hidden;
        min-width: 0;
        text-overflow: ellipsis;
      }

      .points {
        flex: none;
        min-width: 20px;
        padding: 2px 4px;
        border: 1px solid #c7d2dc;
        border-radius: 4px;
        background: #fff;
        color: #263746;
        font-size: 13px;
        font-weight: 700;
        text-align: center;
        box-shadow: 0 1px 1px rgba(25, 48, 68, 0.08);
      }
    }

    .opponent {
      max-width: min(48%, 190px);
    }
  }

  .game_icons {
    display: inline-block;
    vertical-align: text-top;

    .icon {
      margin-right: -20px;
    }
  }

  .title {
    font-size: 18px;
    display: inline-block;
    margin-top: 12px;
  }

  .created_at {
    color: #888;
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .last_move {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 400px;
    line-height: 20px;
    display: inline-block;
    margin-top: 2px;

    .total_points {
      font-size: 18px;
      font-weight: 700;
    }

    .words_made {
      font-weight: 700;
    }

    .point_gain {
      color: #888;
    }
  }
}

.game_line_item {
  display: flex;
  height: 76px;

  > .avatar {
    flex: none;
    width: 76px !important;
    height: 76px !important;
  }

  .game_line_content {
    box-sizing: border-box;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    height: 76px;
    overflow: hidden;
    padding: 3px 10px 3px 0;
  }

  .game_title_line {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex: 0 0 19px;
    gap: 6px;
    min-width: 0;
    width: 100%;
    padding-right: 110px;

    .title {
      overflow: hidden;
      min-width: 0;
      margin: 0;
      line-height: 19px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .game_icons {
      flex: none;
    }
  }

  .score {
    flex: 0 0 auto;
    max-width: 100%;
    margin-top: 0;
  }

  .last_move {
    box-sizing: border-box;
    display: block;
    flex: 0 0 18px;
    width: 100%;
    max-width: 100%;
    height: 18px;
    margin-top: 0;
    padding-right: 70px;

    .dict {
      position: relative;
      z-index: 2;
    }
  }
}

.games_list .line_item {
  font-size: 15px;

  .title, .pending_username, .last_move .total_points {
    font-size: 17px;
  }

  .score .username {
    font-size: 15px;
  }

  .last_move {
    line-height: 18px;
  }
}

.games_list .active_game {
  .title {
    margin-top: 0;
  }

  .score {
    margin-top: 0;
  }

  .last_move {
    margin-top: 0;
  }
}

.pending_game {
  .title {
    margin-top: 4px;
  }

  .pending_username {
    display: block;
    font-family: 'Acme';
    font-size: 18px;
    margin-top: 5px;
  }
}

.finished_game {
  background-color: whitesmoke;

  .result {
    font-size: 18px;
    position: absolute;
    right: 10px;
    bottom: 10px;

    .value {
      .won {
        color: limegreen;
      }

      .lost {
        color: crimson;
      }

      .draw {
        color: dodgerblue;
      }
    }
  }
}

.friend_item {
  .new_message {
    margin-top: 5px;
    color: dodgerblue;
  }

  .username {
    margin-top: 4px;
  }

  .content {
    margin-top: 5px;
    font-style: italic;
    font-size: 12px;
    color: grey;
  }
}
